Re: drop table and references

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "Martin A(dot) Marques" <martin(at)math(dot)unl(dot)edu(dot)ar>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: drop table and references
Date: 2001-01-09 23:02:18
Message-ID: Pine.BSF.4.21.0101091501080.69680-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Tue, 9 Jan 2001, Martin A. Marques wrote:

> I have a big doubt. If I drop a table with a primary key to which other
> tables reference to, what happens? And If I create the table again, just as
> it was, but maybe with another column?

Theoretically (ie, assuming no bugs), when you drop the table the foreign
key constraints are dropped as well. If you recreate the table the
constraints are not recreated, you'd have to use ALTER TABLE ADD
CONSTRAINT to make them again.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-01-09 23:50:09 Re: Re: COPY error: pqReadData() -- backend closed the channel unexpectedly
Previous Message Andrew W. Nosenko 2001-01-09 22:27:17 Re: is there a vendor independent C API for DB development?