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

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: bug report: pg_dump does not use CASCADE in DROP
Дата
Msg-id 200308302146.h7ULk1B10086@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: bug report: pg_dump does not use CASCADE in DROP  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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.

Yep.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: bug report: pg_dump does not use CASCADE in DROP
Следующее
От:
Дата:
Сообщение: "Returned due to virus; was:" Re: Your application