Chris Mair <[EMAIL PROTECTED]> writes:
> On the italian list we're discussing a case were a user reportedly
> worked around this (i.e. got rid of unwanted cascading calls) by
> writing an on insert trigger procedure something on the lines of:

> ALTER TABLE tab DISABLE TRIGGER USER;
>   -- do more inserts into the same table
> ALTER TABLE tab ENABLE TRIGGER USER;

> While this reporetedly worked well in 8.2.1 it does not in 8.2.4
> resulting in an error:
>    ERROR: relation "distinta_base1" is being used by active queries
>    in this session Stato SQL: 55006

We could possibly re-allow that (see the comments in AlterTable())
but it seems like an ugly and inefficient technique that we shouldn't
be encouraging.  (The implications for system catalog bloat alone
seem enough reason to not recommend this.)  Isn't there a cleaner way
to design his application?  Maybe refactor the schema to avoid the
recursion in the first place?  Or add an "insert origin" column to the
table so that the trigger can easily detect trigger-inserted rows and
do nothing?

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

                http://www.postgresql.org/about/donate

Reply via email to