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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Preston Landers <planders(at)journyx(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: bug report: pg_dump does not use CASCADE in DROP
Date: 2003-09-10 00:03:18
Message-ID: 200309100003.h8A03Id14514@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Added to TODO:

* Have pg_dump -c clear the database using dependency
information

---------------------------------------------------------------------------

Preston Landers wrote:
> ============================================================================
> 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.
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-09-10 06:39:01 Re: PG 7.4 beta 2: COPY IN, arrays, and double quotes bug.
Previous Message kaab kaoutar 2003-09-09 17:41:47 to_timestamp and to_date fails in postgresql 7.1.3