Re: AfterTriggerSaveEvent() called outside of query
| От | Tom Lane |
|---|---|
| Тема | Re: AfterTriggerSaveEvent() called outside of query |
| Дата | |
| Msg-id | 1603.1289929245@sss.pgh.pa.us обсуждение |
| Ответ на | AfterTriggerSaveEvent() called outside of query (Vick Khera <vivek@khera.org>) |
| Ответы |
Re: AfterTriggerSaveEvent() called outside of query
|
| Список | pgsql-general |
Vick Khera <vivek@khera.org> writes:
> The code looks basically like this, for each owner_id ($oid) targeted
> for the purge:
> BEGIN;
> SET LOCAL synchronous_commit TO OFF;
> SET CONSTRAINTS ALL DEFERRED;
> foreach table (owner_log, ... user_list, invoices, ... )
> DELETE FROM $table WHERE owner_id=$oid
> UPDATE owner SET status='terminated' WHERE owner_id=$oid
> INSERT INTO admin_log (.... record of account being purged ... );
> COMMIT;
> This worked just dandy without the two SET commands above I added
> yesterday to try to speed things up. (Yes, the constraints are marked
> as deferrable...) What happens is now I get the following error:
> ERROR: AfterTriggerSaveEvent() called outside of query
The code comment associated with that error message says:
* Check state. We use normal tests not Asserts because it is possible
* to reach here in the wrong state given misconfigured RI triggers,
* in particular deferring a cascade action trigger.
The system will not normally allow cascade actions to be deferred
... did you manually munge the pg_trigger entries? If you managed
to provoke this purely through DDL commands, that would be a bug,
and I'd like to see how you did it.
regards, tom lane
В списке pgsql-general по дате отправления: