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

From Peter Eisentraut
Subject Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
Date
Msg-id 5294FC63.2090401@gmx.net
Whole thread Raw
In response to Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
List pgsql-hackers
On 11/24/13, 2:28 PM, Pavel Stehule wrote:
> Note: DROP TRIGGER ON tablename is PostgreSQL feature - no other
> databases (without PostgreSQL forks) uses this syntax - so we don't need
> thinking what is in (or what will be) in ANSI standard (or what other
> databases does). In this moment syntax of DROP TRIGGER is non standard.
> So if we can adopt design (idea) in SQL anywhere or MySQL, then DROP
> TRIGGER IF EXISTS should be enough. In our implementation there are two
> conditions,  but we should not to check if target table exists (from
> statement purpose).

Right, we might as well consider 'trigger ON tablename' to be the full
name of the trigger and just treat it like a unit.

But then a single IF EXISTS clause is still inconsistent with DROP TABLE
nonexistent.foo, which fails if the schema does not exist.  In other
words, the IF EXISTS clause only applies to the end of an name chain.




pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE
Next
From: Robert Haas
Date:
Subject: Re: Incomplete freezing when truncating a relation during vacuum