Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLT6V-0007EN-Fn for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Sep 2013 07:20:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VLT6U-0001Ot-Qu for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Sep 2013 07:20:14 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLT6T-0001OM-C5 for pgsql-hackers@postgresql.org; Mon, 16 Sep 2013 07:20:13 +0000 Received: from mail-pd0-f169.google.com ([209.85.192.169]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLT6L-0008Kp-TP for pgsql-hackers@postgresql.org; Mon, 16 Sep 2013 07:20:12 +0000 Received: by mail-pd0-f169.google.com with SMTP id r10so3790135pdi.28 for ; Mon, 16 Sep 2013 00:20:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=ec27b0SpTpAQteiFnS9ZIRxfFMtC4RvFPIz15xAm/+k=; b=A+llDC5e+Wio19/OLGkTmS7QVmc+XCV65f1mPBDFpcjPWB+EutAI94u1evQmU56vbh mW752h1IRai8QRezqWCRtmVdRbOpsN8qfjhVd7ew/IQTs/aP7EYMw5Spkc15uzq8+p1o q1OJYV0cxNH+2Z3+pY/AO4mxtZ6FVbd6KxR0+Lz1H+eDsuhe1wn9dTskGA6m3l45shix 2nA35wAv/Ok9Nl5rOwIyOmsinHcldGgDR5VVG4DW13PiklkZRfwBkT1JTbSyykSzok7B 91dT4mIXPMbkPYZ1qMPd3n7ooywoJYgptVxULVFgTI3x/ykIl033ba+eBqCduiQ7b/SV hWCw== X-Gm-Message-State: ALoCoQlix21gSWDiAEHhFQaouYv2sHp/xKV382tyW50D4nqrYkyrBD2Xs+P5RKb4F1Fo+BZLhX9S X-Received: by 10.66.246.229 with SMTP id xz5mr1479874pac.128.1379316004525; Mon, 16 Sep 2013 00:20:04 -0700 (PDT) Received: from [192.168.2.58] (218-42-155-17.cust.bit-drive.ne.jp. [218.42.155.17]) by mx.google.com with ESMTPSA id xe9sm36533122pab.0.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Sep 2013 00:20:03 -0700 (PDT) Message-ID: <5236B11B.8040700@uptime.jp> Date: Mon, 16 Sep 2013 16:19:55 +0900 From: Satoshi Nagayasu User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Pavel Stehule CC: Josh Kupershmidt , Tom Lane , Bruce Momjian , Dave Rolsky , pgsql-hackers Subject: Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist References: <20130215203205.GC12030@momjian.us> <20130215234637.GH12030@momjian.us> <11257.1361032501@sss.pgh.pa.us> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.1 (-) 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 (2013/07/06 1:16), Pavel Stehule wrote: > I am sending a patch that removes strict requirements for DROP IF > EXISTS statements. This behave is similar to our ALTER IF EXISTS > behave now. > > > postgres=# DROP CAST IF EXISTS (sss AS public.casttesttype); > NOTICE: types "sss" and "public.casttesttype" does not exist, skipping > DROP CAST > postgres=# DROP FUNCTION IF EXISTS public.pt_in_widget(point, widget); > NOTICE: function public.pt_in_widget(point,widget) does not exist, skipping > DROP FUNCTION > postgres=# DROP OPERATOR IF EXISTS public.<% (point, widget); > NOTICE: operator public.<% does not exist, skipping > DROP OPERATOR > postgres=# DROP TRIGGER test_trigger_exists ON no_such_table; > ERROR: relation "no_such_table" does not exist > postgres=# DROP TRIGGER IF EXISTS test_trigger_exists ON no_such_table; > NOTICE: trigger "test_trigger_exists" for table "no_such_table" does > not exist, skipping > DROP TRIGGER > > This functionality is necessary for correct quite reload from dump > without possible warnings I'm looking at this patch, and I have a question here. Should "DROP TRIGGER IF EXISTS" ignore error for non-existing trigger and non-existing table? Or just only for non-existing trigger? I've not understood the pg_restore issue precisely so far, but IMHO "DROP TRIGGER IF EXISTS" means "if the _trigger_ exists", not "if the _table_ exists". Is this a correct and/or an expected behavior? Sorry if I missed some consensus which we already made. Any comments? Regards, -- Satoshi Nagayasu Uptime Technologies, LLC. http://www.uptime.jp -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers