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

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)2ndquadrant(dot)com>, Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL Hackers <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-26 19:54:11
Message-ID: 5294FC63.2090401@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs 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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Eduardo Armendariz 2013-11-26 20:33:38 Re: BUG #8612: Truncate did not release disk space
Previous Message Tom Lane 2013-11-26 17:22:08 Re: BUG #8629: Strange resultset when using CTE or a subselect

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-11-26 20:07:35 Re: Incomplete freezing when truncating a relation during vacuum
Previous Message Heikki Linnakangas 2013-11-26 19:32:11 Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE