Search Postgresql Archives

Re: AfterTriggerSaveEvent() called outside of query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vick Khera <vivek@xxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux