Re: [BUGS] 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-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
Date: 2013-07-05 16:16:09
Message-ID: CAFj8pRCLmnA9B2ROnzmwjAjCBq--p-P_2Kq_21N21YX1Kdd8cA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Hello

I am sending a patch that removes strict requirements for DROP IF
EXISTS statements. This behave is similar to our ALTER IF EXISTS
behave now.

postgres=# DROP CAST IF EXISTS (sss AS public.casttesttype);
NOTICE: types "sss" and "public.casttesttype" does not exist, skipping
DROP CAST
postgres=# DROP FUNCTION IF EXISTS public.pt_in_widget(point, widget);
NOTICE: function public.pt_in_widget(point,widget) does not exist, skipping
DROP FUNCTION
postgres=# DROP OPERATOR IF EXISTS public.<% (point, widget);
NOTICE: operator public.<% does not exist, skipping
DROP OPERATOR
postgres=# DROP TRIGGER test_trigger_exists ON no_such_table;
ERROR: relation "no_such_table" does not exist
postgres=# DROP TRIGGER IF EXISTS test_trigger_exists ON no_such_table;
NOTICE: trigger "test_trigger_exists" for table "no_such_table" does
not exist, skipping
DROP TRIGGER

This functionality is necessary for correct quite reload from dump
without possible warnings

Regards

Pavel

2013/7/2 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
> Hello
>
> remastered patch
>
> still there is a issue with dependencies
>
> Regards
>
> Pavel Stehule
>
>
>
>
> 2013/6/17 Josh Kupershmidt <schmiddy(at)gmail(dot)com>:
>> On Fri, Mar 8, 2013 at 11:58 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>>
>>> I'll see - please, stay tuned to 9.4 first commitfest
>>
>> Hi Pavel,
>> Just a reminder, I didn't see this patch in the current commitfest. I
>> would be happy to spend some more time reviewing if you wish to pursue
>> the patch.
>>
>> Josh

Attachment Content-Type Size
drop-if-exists-no-double-check.patch application/octet-stream 18.6 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message lindebg 2013-07-06 20:41:39 BUG #8287: select distinct / select group by - Invalid result
Previous Message Michael Paquier 2013-07-05 05:05:49 Re: BUG #8286: severe bug in auth

Browse pgsql-hackers by date

  From Date Subject
Next Message Hitoshi Harada 2013-07-05 16:16:41 Re: [PATCH] Add transforms feature
Previous Message Peter Eisentraut 2013-07-05 16:08:18 Re: [PATCH] Add transforms feature