Re: BUG #7873: pg_restore --clean tries to drop tables that don't exist - Mailing list pgsql-bugs

From Josh Kupershmidt
Subject Re: BUG #7873: pg_restore --clean tries to drop tables that don't exist
Date
Msg-id CAK3UJRFimHstfo5KDqhfDS+1Oq7ji0SLWF-JGRye_LvkKQ8spw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #7873: pg_restore --clean tries to drop tables that don't exist  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: BUG #7873: pg_restore --clean tries to drop tables that don't exist  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-bugs
On Tue, Feb 19, 2013 at 6:00 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> 2013/2/16 Pavel Stehule <pavel.stehule@gmail.com>:
>> 2013/2/16 Tom Lane <tgl@sss.pgh.pa.us>:
>>> I think it has come up before.  I wouldn't object to a pg_dump option to
>>> add IF EXISTS to all the drop commands (though changing the default
>>> behavior would be more controversial).  Don't intend to spend my own
>>> time on it though ...

FYI, it was proposed here:
http://www.postgresql.org/message-id/507AD08C.5020603@dalibo.com

> here is patch, that we use about one year - originally for 9.1 - I did
> port to 9.3

dropdb and dropuser both support a similar option named --if-exists. I
suggest --if-exists instead of --conditional-drops for consistency.
I've only glanced at the patch, but if it makes no sense to use
--conditional-drops (or --if-exists, whatever it ends up being called)
without --clean, then attempting to do so should raise an error.

Josh

pgsql-bugs by date:

Previous
From: bogdan.magajna@gmail.com
Date:
Subject: BUG #7898: mapinfo 11.5.2 connection problem
Next
From: Heikki Linnakangas
Date:
Subject: Re: BUG #7883: "PANIC: WAL contains references to invalid pages" on replica recovery