Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VfeMM-00058t-D5 for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Nov 2013 23:24:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VfeML-0000Mg-Jt for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Nov 2013 23:24:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VfeMK-0000MY-P5 for pgsql-hackers@postgresql.org; Sun, 10 Nov 2013 23:24:00 +0000 Received: from moutng.kundenserver.de ([212.227.17.8]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VfeMI-0003V9-0P for pgsql-hackers@postgresql.org; Sun, 10 Nov 2013 23:24:00 +0000 Received: from anarazel.de (p5DDC55B8.dip0.t-ipconnect.de [93.220.85.184]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0Li1j8-1VKMFF41mk-00mXAl; Mon, 11 Nov 2013 00:23:56 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 2020E1024D3; Mon, 11 Nov 2013 00:23:55 +0100 (CET) Date: Mon, 11 Nov 2013 00:23:55 +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: <20131110232355.GG32665@awork2.anarazel.de> References: <5236B11B.8040700@uptime.jp> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5459.1384125376@sss.pgh.pa.us> X-Provags-ID: V02:K0:FBYsMOGcbJYuEyUqiwB4heRsXxFsvepv+SRHuLFvXJe mwZYj5J6cDbhAhz6SYqoj5R4aWSOlq09jHTmXE81AWvSsgmZda mcHprLQGOEXh8w6nS2kymWtI4NTF3mAr7PyYOs8nGK+UPsNTsY eJD6XMozM6eSmSeYofnXWfQls43zPavEIcSRJCv7EtfQwGLlqg w8Fgju2NjiJrlCqLZ5cJP0zJvc+VqHNYSf2vIc94oADwB0ZYbt EbZv/cLBZkk0o8KdnSoA5m7qa7RIE+ERp1dmSjspOqNX/tmaeA pPFkZsOiWa2o39KXe+kmakin5DWOY6jyMmds/dwQ7FmRIz7GSY b/7M3hQ/uShqpySvzxtj8MsS0JR14QppOe2pGNjj6 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:16:16 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2013-11-10 16:28:27 -0500, Tom Lane wrote: > >> I think this is nonsense. It's only one step removed from "why do you > >> need IF EXISTS at all, you should know whether the object is there". > >> The entire point of this syntax is to not need to do detailed analysis > >> about whether the object is there. > > > Well, in my opinion the IF EXISTS refers to the object type being > > dropped. I.e. with DROP TABLE it refers to the table not existing, with > > DROP TRIGGER it refers to the trigger not existing. > > 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. 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