From: Tom Lane <tgl@sss.pgh.pa.us>
To: craig perras <craigp98072@yahoo.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: cleaning up in UDF's (user-defined functions)
Date: Wed, 09 Jun 2004 10:53:41 -0400
Message-ID: <21081.1086792821@sss.pgh.pa.us> (raw)
In-Reply-To: <20040609022908.43286.qmail@web21208.mail.yahoo.com>
References: <20040609022908.43286.qmail@web21208.mail.yahoo.com>
craig perras <craigp98072@yahoo.com> writes:
> 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?
What resources? Most stuff (like palloc'd memory) is taken care of
for you. If you're maintaining your own private permanent data
structures then you may need to plug in a transaction-end hook
routine to clean those up.
pgsql-interfaces is hardly the place for discussing how to write
C-language server functions; if you want to discuss the fine points
I'd suggest pgsql-hackers.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, craigp98072@yahoo.com
Subject: Re: cleaning up in UDF's (user-defined functions)
In-Reply-To: <21081.1086792821@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox