pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: sergey@booksys.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7641: ERROR: must specify relation and object name when function contains DROP TRIGGER
Date: Thu, 08 Nov 2012 11:14:21 -0500
Message-ID: <25022.1352391261@sss.pgh.pa.us> (raw)
In-Reply-To: <E1TWAFr-0003G3-AY@wrigleys.postgresql.org>
References: <E1TWAFr-0003G3-AY@wrigleys.postgresql.org>

sergey@booksys.com writes:
> CREATE OR REPLACE FUNCTION drop_trigger_test() RETURNS void AS $$
> BEGIN
>    DROP TRIGGER IF EXISTS invalid_trigger ON test1;
> END; $$ LANGUAGE plpgsql;

> 4. SELECT drop_trigger_test();
> Result:
> NOTICE:  trigger "invalid_trigger" for table "test1" does not exist,
> skipping
> CONTEXT:  SQL statement "DROP TRIGGER IF EXISTS invalid_trigger ON test1"
> PL/pgSQL function drop_trigger_test() line 3 at SQL statement

> 5. SELECT drop_trigger_test();
> Result:
> ERROR:  must specify relation and object name
> CONTEXT:  SQL statement "drop trigger if exists invalid_trigger on test2"
> PL/pgSQL function drop_trigger_test2() line 3 at SQL statement

> For some reason I can run this function without error only once on a fresh
> connection. Did not have this problem in 8.4.x and 9.1.6

That's a bug all right --- the does_not_exist_skipping() function thinks
it's okay to trash its input data structure, so the DropStmt is
corrupted for next time.  Will fix, thanks for the report!

			regards, tom lane




view thread (3+ messages)  latest in thread

Message-ID: <25022.1352391261@sss.pgh.pa.us>
Permalink:  ../25022.1352391261@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25022.1352391261@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, sergey@booksys.com
  Subject: Re: BUG #7641: ERROR: must specify relation and object name when function contains DROP TRIGGER
  In-Reply-To: <25022.1352391261@sss.pgh.pa.us>
  References: <E1TWAFr-0003G3-AY@wrigleys.postgresql.org> <25022.1352391261@sss.pgh.pa.us>

* 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