Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VfesQ-0006II-4k for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Nov 2013 23:57:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VfesP-0007R0-GE for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Nov 2013 23:57:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VfesO-0007Qr-81 for pgsql-hackers@postgresql.org; Sun, 10 Nov 2013 23:57:08 +0000 Received: from moutng.kundenserver.de ([212.227.126.171]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VfesL-00046T-Lr for pgsql-hackers@postgresql.org; Sun, 10 Nov 2013 23:57:07 +0000 Received: from anarazel.de (p5DDC55B8.dip0.t-ipconnect.de [93.220.85.184]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LswsU-1VZqL731b8-0121p2; Mon, 11 Nov 2013 00:57:03 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 0FC0510252B; Mon, 11 Nov 2013 00:57:03 +0100 (CET) Date: Mon, 11 Nov 2013 00:57:03 +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: <20131110235703.GJ32665@awork2.anarazel.de> References: <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> <5940.1384126931@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5940.1384126931@sss.pgh.pa.us> X-Provags-ID: V02:K0:PLPmlSrCZ2JY72Zdp6n9VsMR9H2JdCrFg+nk/ceP2bZ bA3a1vtvXIiK7pp6TPV2q7S3C7tJvyGgBv8xkx/+KYi0D27NUl oEyk0R2hZTmZH0IN1M2Tl3Ashz82D+etnTHSazxAELmud5Mao5 etLiaQwtmXqcNLH4jCgOHIVK3tO9esFKTwVUCZaM6X16Z7TaA1 wwKb0NKy+aLlOVFSfUOLH14Rb4y1lQ87fM9q7107ELpVVIwrq+ HopeHiUGC2eLaKvljeddZsSaGRjq9dhdf4MeEGrOr9Hjb0hTIS I1Muuff40whd2MOYAH3quwnVAZ1aPmcQ0i2RcT+Qu4gAtxFnlz tDA9tVZE6EouS8d9cWYqC2HxY80T5WpJ7oTY9vOaJ 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:42:11 -0500, Tom Lane wrote: > Andres Freund writes: > > ... So we'd get approximately one line further unless we fix this for DROP > > DEFAULT and DROP CONSTRAINT as well. Turns out that's bogus - ALTER TABLE has two levels of NOT EXISTS. Maybe we should just do the same for DROP TRIGGER? DROP TRIGGER [ IF EXISTS ] name ON table_name [ IF EXISTS ] [ CASCADE | RESTRICT ] > However, the server-side approach has the benefit that it'll > likely make life easier for other applications besides pg_dump. I am unconvinced that that's the case when using the existing IF EXISTS for DROP TRIGGER, but my complaints would be completely addressed by making it a separate flag. 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