Re: ERROR: relation xxx is still open (Re: Use Trigger to Remove Table ... )

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ERROR: relation xxx is still open (Re: Use Trigger to Remove Table ... )
Дата
Msg-id 6384.1265127080@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ERROR: relation xxx is still open (Re: Use Trigger to Remove Table ... )  (Josh Kupershmidt <schmiddy@gmail.com>)
Список pgsql-general
Josh Kupershmidt <schmiddy@gmail.com> writes:
> For the record, I think having a trigger drop a table automatically when
> it's empty is probably a bad idea. But I tried it out anyways, and got a
> surprising:
> ERROR:  relation 16400 is still open
> when the trigger function attempted to drop the table.

> Can anyone say whether the error message I'm seeing is valid?

It's unsurprising, anyway.  The code firing the trigger would be holding
the relation open.  I'm not sure whether there's a good reason for
referring to the table by OID instead of name there, but this is a
pretty low-level failure anyway.

There are any number of reasons why we'd not be likely to try to support
this.  What if the trigger tries to refer to NEW or OLD afterwards, when
the information about the table's rowtype is already gone?  What if
there are more trigger firings pending for the table?

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problem with partition tables and schemas
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Questions on PostGreSQL Authentication mechanism...