pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Tomas Vondra <tv@fuzzy.cz>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
Date: Mon, 11 Nov 2013 00:32:47 +0100
Message-ID: <20131110233247.GH32665@awork2.anarazel.de> (raw)
In-Reply-To: <5647.1384125986@sss.pgh.pa.us>
References: <CAFj8pRAyO-H5QQJ+853YsO_CZNeNrr7=Z9qjRuC4y5cmWtWyjw@mail.gmail.com>
	<5256DBBF.8010605@dunslane.net>
	<20131014214421.GE25013@awork2.anarazel.de>
	<525C6ED3.9090701@fuzzy.cz>
	<20131014222800.GH25013@awork2.anarazel.de>
	<3210.1384118907@sss.pgh.pa.us>
	<20131110221159.GD32665@awork2.anarazel.de>
	<5459.1384125376@sss.pgh.pa.us>
	<20131110232355.GG32665@awork2.anarazel.de>
	<5647.1384125986@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 2013-11-10 18:26:26 -0500, Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
> > On 2013-11-10 18:16:16 -0500, Tom Lane wrote:
> >> Then I take it you also think we should undo the changes that made
> >> "DROP TABLE IF EXISTS foo.bar" not fail if schema foo doesn't exist?
> >> Because after all, the schema is not the object being dropped.
> 
> > No, not the same thing imo, although I find that change debatable.
> 
> > Anyway, if we're going to change DROP TRIGGER at the very least ALTER
> > TABLE ... DROP CONSTRAINT also needs to be changed, otherwise we'll gain
> > nothing.
> 
> That would be a plausible next step, but I don't have a problem with
> this patch not solving every case like this at once.

Well, there are relatively few tables without primary keys around that
have triggers. The dumps currently look like:
DROP TRIGGER foo ON public.foo;
ALTER TABLE ONLY public.foo DROP CONSTRAINT foo_pkey;
ALTER TABLE public.foo ALTER COLUMN id DROP DEFAULT;
DROP SEQUENCE public.foo_id_seq;
DROP TABLE public.foo;
So we'd get approximately one line further unless we fix this for DROP
DEFAULT and DROP CONSTRAINT as well.

Greetings,

Andres Freund

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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (83+ messages)  latest in thread

Message-ID: <20131110233247.GH32665@awork2.anarazel.de>
Permalink:  ../20131110233247.GH32665@awork2.anarazel.de/
Also on:    postgresql.org/message-id/20131110233247.GH32665@awork2.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andres@2ndquadrant.com, tgl@sss.pgh.pa.us, tv@fuzzy.cz, pgsql-hackers@postgresql.org
  Subject: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
  In-Reply-To: <20131110233247.GH32665@awork2.anarazel.de>
  References: <CAFj8pRAyO-H5QQJ+853YsO_CZNeNrr7=Z9qjRuC4y5cmWtWyjw@mail.gmail.com> <5256DBBF.8010605@dunslane.net> <20131014214421.GE25013@awork2.anarazel.de> <525C6ED3.9090701@fuzzy.cz> <20131014222800.GH25013@awork2.anarazel.de> <3210.1384118907@sss.pgh.pa.us> <20131110221159.GD32665@awork2.anarazel.de> <5459.1384125376@sss.pgh.pa.us> <20131110232355.GG32665@awork2.anarazel.de> <5647.1384125986@sss.pgh.pa.us> <20131110233247.GH32665@awork2.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox