pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Satoshi Nagayasu <snaga@uptime.jp>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Josh Kupershmidt <schmiddy@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Dave Rolsky <autarch@urth.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
Date: Mon, 16 Sep 2013 16:19:55 +0900
Message-ID: <5236B11B.8040700@uptime.jp> (raw)
In-Reply-To: <CAFj8pRCLmnA9B2ROnzmwjAjCBq--p-P_2Kq_21N21YX1Kdd8cA@mail.gmail.com>
References: <E1U5iqp-0000nA-Uh@wrigleys.postgresql.org>
	<20130215203205.GC12030@momjian.us>
	<alpine.DEB.2.00.1302151604450.13270@urth.org>
	<20130215234637.GH12030@momjian.us>
	<11257.1361032501@sss.pgh.pa.us>
	<CAFj8pRBihcCEK-bcQEgCqLdLjQQ+J5PUyeZTekXHi_hoaEkoBw@mail.gmail.com>
	<CAFj8pRDwqTXnc+rEUAVc4H5Hx1F_0hKNA-9F+2FgCu18aXtY4A@mail.gmail.com>
	<CAK3UJRFimHstfo5KDqhfDS+1Oq7ji0SLWF-JGRye_LvkKQ8spw@mail.gmail.com>
	<CAFj8pRB8wvrMz57hR5YJ-QFe6AmMp6r7TXLmJL64PxBawPmweA@mail.gmail.com>
	<CAK3UJRG__4=+f46XaMiqA80f_-BQhJcpFwyp8g8fpSPqj-JSzA@mail.gmail.com>
	<CAFj8pRBX_+z2XbUSORZA+dv6rk38wvMnM5V8DROGFVrh2ETKjg@mail.gmail.com>
	<CAK3UJRGEmtV477gu8Rvh+TUcRQHQcsHc=c0Ynu=3KDdV+Vxarw@mail.gmail.com>
	<CAFj8pRBmHAh997SKC1W0GFXWbdSdYebV9g1vM5LLGVLvu3MbLw@mail.gmail.com>
	<CAK3UJRHKmhgTfaHu0PuDPr2HEmR3SJCz-1gZJuW19xN8+ZCZZA@mail.gmail.com>
	<CAFj8pRCk-1h_qHd0+u1iGniX4pemmqyYg--0FqEBZ0azf9+F=A@mail.gmail.com>
	<CAFj8pRCLmnA9B2ROnzmwjAjCBq--p-P_2Kq_21N21YX1Kdd8cA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

(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 <snaga@uptime.jp>
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



view thread (83+ messages)  latest in thread

Message-ID: <5236B11B.8040700@uptime.jp>
Permalink:  ../5236B11B.8040700@uptime.jp/
Also on:    postgresql.org/message-id/5236B11B.8040700@uptime.jp

 · 

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: snaga@uptime.jp, pavel.stehule@gmail.com, schmiddy@gmail.com, tgl@sss.pgh.pa.us, bruce@momjian.us, autarch@urth.org, pgsql-hackers@postgresql.org
  Subject: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
  In-Reply-To: <5236B11B.8040700@uptime.jp>
  References: <E1U5iqp-0000nA-Uh@wrigleys.postgresql.org> <20130215203205.GC12030@momjian.us> <alpine.DEB.2.00.1302151604450.13270@urth.org> <20130215234637.GH12030@momjian.us> <11257.1361032501@sss.pgh.pa.us> <CAFj8pRBihcCEK-bcQEgCqLdLjQQ+J5PUyeZTekXHi_hoaEkoBw@mail.gmail.com> <CAFj8pRDwqTXnc+rEUAVc4H5Hx1F_0hKNA-9F+2FgCu18aXtY4A@mail.gmail.com> <CAK3UJRFimHstfo5KDqhfDS+1Oq7ji0SLWF-JGRye_LvkKQ8spw@mail.gmail.com> <CAFj8pRB8wvrMz57hR5YJ-QFe6AmMp6r7TXLmJL64PxBawPmweA@mail.gmail.com> <CAK3UJRG__4=+f46XaMiqA80f_-BQhJcpFwyp8g8fpSPqj-JSzA@mail.gmail.com> <CAFj8pRBX_+z2XbUSORZA+dv6rk38wvMnM5V8DROGFVrh2ETKjg@mail.gmail.com> <CAK3UJRGEmtV477gu8Rvh+TUcRQHQcsHc=c0Ynu=3KDdV+Vxarw@mail.gmail.com> <CAFj8pRBmHAh997SKC1W0GFXWbdSdYebV9g1vM5LLGVLvu3MbLw@mail.gmail.com> <CAK3UJRHKmhgTfaHu0PuDPr2HEmR3SJCz-1gZJuW19xN8+ZCZZA@mail.gmail.com> <CAFj8pRCk-1h_qHd0+u1iGniX4pemmqyYg--0FqEBZ0azf9+F=A@mail.gmail.com> <CAFj8pRCLmnA9B2ROnzmwjAjCBq--p-P_2Kq_21N21YX1Kdd8cA@mail.gmail.com> <5236B11B.8040700@uptime.jp>

* 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