Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TWAG0-0001gh-7M for pgsql-bugs@postgresql.org; Wed, 07 Nov 2012 18:21:44 +0000 Received: from mahout.postgresql.org ([98.129.198.123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TWAFu-000414-5c for pgsql-bugs@postgresql.org; Wed, 07 Nov 2012 18:21:43 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TWAFs-0005D3-1e for pgsql-bugs@postgresql.org; Wed, 07 Nov 2012 18:21:36 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1TWAFr-0003G3-AY for pgsql-bugs@postgresql.org; Wed, 07 Nov 2012 18:21:35 +0000 Date: Wed, 07 Nov 2012 18:21:35 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7641: ERROR: must specify relation and object name when function contains DROP TRIGGER To: pgsql-bugs@postgresql.org From: sergey@booksys.com X-Pg-Spam-Score: -2.3 (--) X-Archive-Number: 201211/37 X-Sequence-Number: 34595 The following bug has been logged on the website: Bug reference: 7641 Logged by: Sergey Email address: sergey@booksys.com PostgreSQL version: 9.2.1 Operating system: Windows XP / Ubuntu 10.04 (Lucid) Description: = Postgres 9.2.1 Reproduced the problem on Windows XP and Ubuntu 10.04 Steps to reproduce: 1. Create a new database: = CREATE DATABASE test; = Connect to the new database. 2. CREATE TABLE test1 (id int); 3. = 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