bug report: pg_dump does not use CASCADE in DROP - Mailing list pgsql-bugs

From Preston Landers
Subject bug report: pg_dump does not use CASCADE in DROP
Date
Msg-id Pine.LNX.4.33.0308281409440.6957-100000@dev2.int.journyx.com
Whole thread Raw
Responses Re: bug report: pg_dump does not use CASCADE in DROP
Re: bug report: pg_dump does not use CASCADE in DROP
List pgsql-bugs
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name        :    Preston Landers
Your email address    :  planders@journyx.com


System Configuration
---------------------
  Architecture (example: Intel Pentium)      :
Intel Pentium II 500mhz (dual CPU)

  Operating System (example: Linux 2.0.26 ELF)     :
Linux 2.4.2-2smp (Redhat 7.1)

  PostgreSQL version (example: PostgreSQL-7.3):
PostgreSQL-7.4beta2 snapshot (from 2003/8/26.)

  Compiler used (example:  gcc 2.95.2)        :
GCC 2.96


Please enter a FULL description of your problem:
------------------------------------------------

I'm not sure if this is a bug report, feature request, or evidence of my
infirmity, but here it goes:

pg_dump from 7.3+ does not use the CASCADE in the DROP statements (when
the -c clean option is used.)

This is a problem when you are trying to restore the dump back onto
the same site and tables already exist, or perhaps this is just an error
in my understanding of how you perform Postgresql backup and restores.



Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

Do a pg_dump -c.  Restore it back to the same site.  The tables will
not be dropped if they have FK constraints or any other dependencies,
resulting in an incorrect restore.


If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Simply include the CASCADE option on all DROP TABLE, INDEX, VIEW, and
TRIGGER statements.  If you feel this is too dangerous, at least
provide it as a command-line option to pg_dump, so people don't have
to hand-edit their dump files to be able to restore them.

pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Suggestion on documentation
Next
From: Karthik K S
Date:
Subject: True64 Unix v5.1 - postgresql-7.2.4 compilation problem