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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Dave Rolsky <autarch(at)urth(dot)org>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7873: pg_restore --clean tries to drop tables that don't exist
Date: 2013-02-23 21:51:31
Message-ID: CAFj8pRB8wvrMz57hR5YJ-QFe6AmMp6r7TXLmJL64PxBawPmweA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Hello

2013/2/21 Josh Kupershmidt <schmiddy(at)gmail(dot)com>:
> On Tue, Feb 19, 2013 at 6:00 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>> 2013/2/16 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
>>> 2013/2/16 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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.

so

* --conditional-drops replaced by --if-exists
* -- additional check, available only with -c option
* fix bug with dump custom functions

Regards

Pavel

>
> Josh

Attachment Content-Type Size
conditional-drops.patch application/octet-stream 30.4 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Maciek Sakrejda 2013-02-24 00:16:39 Re: BUG #7883: "PANIC: WAL contains references to invalid pages" on replica recovery
Previous Message Peter Geoghegan 2013-02-23 19:10:30 Re: BUG #7903: EAN13s are shown ISBN values

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2013-02-23 22:54:51 Re: pg_xlogdump
Previous Message Mark Kirkwood 2013-02-23 21:51:08 Re: [GENERAL] autoanalyze criteria