bug report: pg_dump does not use CASCADE in DROP

From: Preston Landers <planders(at)journyx(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: bug report: pg_dump does not use CASCADE in DROP
Date: 2003-08-28 19:31:44
Message-ID: Pine.LNX.4.33.0308281409440.6957-100000@dev2.int.journyx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Preston Landers
Your email address : planders(at)journyx(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message zhuangjifeng 2003-08-29 03:21:36 about create type
Previous Message Peter Eisentraut 2003-08-28 17:20:38 Re: Suggestion on documentation