Skip site navigation (1) Skip section navigation (2)

cleaning up in UDF's (user-defined functions)

From: craig perras <craigp98072(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: cleaning up in UDF's (user-defined functions)
Date: 2004-06-09 02:29:08
Message-ID: 20040609022908.43286.qmail@web21208.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
I appended an excerpt from the docs... IIUC, if I make
a DSQL call from a UDF (written in C), and there's a
transaction abort caused by that command, then my
function is never called back. How do I cleanup any
resources the function allocated if this is the case?

I'm not even sure how I could NOTIFY clients, since
the transaction aborted.

thanks!
--craig

Note that if during the execution of a procedure the
transaction is aborted because of an error in a
command, then control will not be returned to your
procedure. Rather, all work will be rolled back and
the server will wait for the next command from the
client. A related restriction is the inability to
execute BEGIN, COMMIT, and ROLLBACK (transaction
control statements) inside a procedure. Both of these
restrictions will probably be changed in the future.



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

Responses

pgsql-interfaces by date

Next:From: Tom LaneDate: 2004-06-09 14:53:41
Subject: Re: cleaning up in UDF's (user-defined functions)
Previous:From: L J BayukDate: 2004-06-09 00:08:19
Subject: Re: Is there a way to describe precision and scale

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group