Re: bug report: pg_dump does not use CASCADE in DROP

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Preston Landers <planders(at)journyx(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: bug report: pg_dump does not use CASCADE in DROP
Date: 2003-08-30 21:28:38
Message-ID: 29956.1062278918@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Tom Lane wrote:
>> The correct use of dependency information would be to sort the DROPs
>> into an order that should succeed *without* CASCADE. (This will
>> actually happen for free AIUI, once pg_dump uses dependency info fully.
>> DROPping in the reverse of a safe creation order should work.)

> Right, but how do you drop two tables that REFERENCE each other? Seems
> you have to use CASCADE in that case.

Nope. It's still the inverse problem of pg_dump. pg_dump would have to
dump such a construction with CREATE TABLEs followed by ALTER TABLE ADD
FOREIGN KEYs, right? So the DROPs issued in reverse order are ALTER
TABLE DROP CONSTRAINTs followed by DROP TABLE.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2003-08-30 21:46:01 Re: bug report: pg_dump does not use CASCADE in DROP
Previous Message Bruce Momjian 2003-08-30 17:28:40 Re: bug report: pg_dump does not use CASCADE in DROP