Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VfeUz-0005QX-0G for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Nov 2013 23:32:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VfeUy-0003D5-Am for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Nov 2013 23:32:56 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VfeUx-0003Cs-0M for pgsql-hackers@postgresql.org; Sun, 10 Nov 2013 23:32:55 +0000 Received: from moutng.kundenserver.de ([212.227.17.9]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VfeUs-0006rn-GC for pgsql-hackers@postgresql.org; Sun, 10 Nov 2013 23:32:52 +0000 Received: from anarazel.de (p5DDC55B8.dip0.t-ipconnect.de [93.220.85.184]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MG9Yd-1Vummu3rpX-00FAnZ; Mon, 11 Nov 2013 00:32:48 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 49A3E10252B; Mon, 11 Nov 2013 00:32:47 +0100 (CET) Date: Mon, 11 Nov 2013 00:32:47 +0100 From: Andres Freund To: Tom Lane Cc: Tomas Vondra , pgsql-hackers@postgresql.org Subject: Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist Message-ID: <20131110233247.GH32665@awork2.anarazel.de> References: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5647.1384125986@sss.pgh.pa.us> X-Provags-ID: V02:K0:kOwruC8WU3qHe8sYtPQkN6rQbbO+dyLsDoBKw3vDrfj iODyIt4BcpjaiAAc4CKkyMqgjc84mzTAVgYnkvRO2sgDtkK2Cy j7N5mf8IcDdTjUAoI0p9DEAXzPM1qTIQtLhKrOp9/sNhT+FGmo YdHA6Aa0oAmGkxzFyHdVNlKwGTQyartOlsgJJR2eel/98EQA55 DYb9gvLpIZjhEhBPLUUk4meBouQt2VUxY7qBm4O2zjKGInrpkk FTM6SzxwoC9YuvFvArbL+FoBUHlwXxleTe4M19UYrMjBUISeFX y52RXzriVIr1QXzLSZjYKhpJgn2QdSn3oTtM1S5NZ0IgcMD355 UugmkFtWZSz3TIycTafa202kOFh4Er+eX5RGClKtB X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2013-11-10 18:26:26 -0500, Tom Lane wrote: > Andres Freund 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