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: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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-19 13:00:07
Message-ID: CAFj8pRDwqTXnc+rEUAVc4H5Hx1F_0hKNA-9F+2FgCu18aXtY4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Hello

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>:
>> Bruce Momjian <bruce(at)momjian(dot)us> writes:
>>> On Fri, Feb 15, 2013 at 04:06:12PM -0600, Dave Rolsky wrote:
>>>> Fair enough. It should probably an option to add "if exists", at
>>>> least. I can't imagine I'm the only using this tool to ship database
>>>> updates around to different machines, some of which may not have new
>>>> tables. I'd really like to be able to know when the restore fails
>>>> versus when it succeeds but is noisy.
>>
>>> All I can say is I don't remember anyone asking for this in the past.
>>
>> 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 ...
>
> we use this feature more than one year.
>
> I'll send patch at Monday

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

Regards

Pavel

>
> Regards
>
> Pavel Stehule
>
>
>
>>
>> regards, tom lane
>>
>>
>> --
>> Sent via pgsql-bugs mailing list (pgsql-bugs(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-bugs

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Kroon 2013-02-19 14:27:09 Re: Nested xmlagg doesn't give a result 9.2.3
Previous Message Peter Kroon 2013-02-19 12:50:26 Re: Nested xmlagg doesn't give a result 9.2.3

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-02-19 13:48:05 Re: [RFC] indirect toast tuple support
Previous Message Amit Kapila 2013-02-19 12:52:40 Re: [PATCH] Add PQconninfoParseParams and PQconninfodefaultsMerge to libpq