Re: BUG #7641: ERROR: must specify relation and object name when function contains DROP TRIGGER

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #7641: ERROR: must specify relation and object name when function contains DROP TRIGGER
Дата
Msg-id 25022.1352391261@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #7641: ERROR: must specify relation and object name when function contains DROP TRIGGER  (sergey@booksys.com)
Ответы Re: BUG #7641: ERROR: must specify relation and object name when function contains DROP TRIGGER  (Sergey <sergey@booksys.com>)
Список pgsql-bugs
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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: sergey@booksys.com
Дата:
Сообщение: BUG #7641: ERROR: must specify relation and object name when function contains DROP TRIGGER
Следующее
От: Sergey
Дата:
Сообщение: Re: BUG #7641: ERROR: must specify relation and object name when function contains DROP TRIGGER