Josh Kupershmidt <schmiddy@xxxxxxxxx> 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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general