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

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tomas Vondra <tv(at)fuzzy(dot)cz>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
Date: 2013-11-10 23:57:03
Message-ID: 20131110235703.GJ32665@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 2013-11-10 18:42:11 -0500, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > ... So we'd get approximately one line further unless we fix this for DROP
> > DEFAULT and DROP CONSTRAINT as well.

Turns out that's bogus - ALTER TABLE has two levels of NOT EXISTS.

Maybe we should just do the same for DROP TRIGGER?

DROP TRIGGER [ IF EXISTS ] name ON table_name [ IF EXISTS ] [ CASCADE | RESTRICT ]

> However, the server-side approach has the benefit that it'll
> likely make life easier for other applications besides pg_dump.

I am unconvinced that that's the case when using the existing IF EXISTS
for DROP TRIGGER, but my complaints would be completely addressed by
making it a separate flag.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message digoal 2013-11-11 00:20:58 Re: BUG #8531: systemtap probe mark(checkpoint__done) error when i read the parameters
Previous Message Tom Lane 2013-11-10 23:42:11 Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Yetter 2013-11-11 00:40:31 Re: all_visible replay aborting due to uninitialized pages
Previous Message Tom Lane 2013-11-10 23:42:11 Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist