Plperl & create contstraint trigger - Mailing list pgsql-general

From Chris Coleman
Subject Plperl & create contstraint trigger
Date
Msg-id 538A2AED987D2F458E7FDDAEE5E1E1357FBF66@secure.eurocom.me.uk
Whole thread Raw
Responses Re: Plperl & create contstraint trigger  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi,

I have written a trigger in plperl (I could not use pgsql due to the
nature of the trigger).  I know CREATE CONSTRAINT TRIGGER is not
intended for general use, but it is pretty important that this trigger
be run on commit of the transaction, as it needs to use data in other
tables that can only be considered final on commit.

When I run the trigger then this error appears in the logs:

postgres FATAL:  BeginInternalSubTransaction: unexpected state END

It is caused by the first call to the spi_exec_query($sql) function.
Would I be correct in assuming that plperl language triggers are not
capable of running from a CREATE CONSTRAINT TRIGGER command?

When the trigger is set up as a normal per row trigger then it executes
without any problems.

Many thanks
Chris

--------------------------------
Chris Coleman
Programmer 
Information Systems
Room PKL1 Phone 369
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

This e-mail is confidential and may be read only by the intended recipient.
If you are not the intended recipient, please do not forward, copy or take
any action based on it and, in addition, please delete this email and
inform the sender.
We cannot be sure that this e-mail or its attachments are free from
viruses.  In keeping with good computing practice, please ensure that
you take adequate steps to check for any viruses.  Before replying
or sending any email to us, please consider that the internet is inherently
insecure and is an inappropriate medium for certain kinds of information.
We reserve the right to access and read all e-mails and attachments
entering or leaving our systems.

Registered office: Eurocom House, Ashbourne Road, Derby DE22 4NB Company number: 01574696. 


pgsql-general by date:

Previous
From: Mayuresh Nirhali
Date:
Subject: Use of PROFILE in Makefiles
Next
From: "Ashish Karalkar"
Date:
Subject: sql server to postgreSQL