X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E7884D1B360 for ; Tue, 8 Jun 2004 23:29:10 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 19615-06 for ; Wed, 9 Jun 2004 02:29:09 +0000 (GMT) Received: from web21208.mail.yahoo.com (web21208.mail.yahoo.com [216.136.175.205]) by svr1.postgresql.org (Postfix) with SMTP id 51998D1B1E0 for ; Tue, 8 Jun 2004 23:29:04 -0300 (ADT) Message-ID: <20040609022908.43286.qmail@web21208.mail.yahoo.com> Received: from [63.251.3.102] by web21208.mail.yahoo.com via HTTP; Tue, 08 Jun 2004 19:29:08 PDT Date: Tue, 8 Jun 2004 19:29:08 -0700 (PDT) From: craig perras Subject: cleaning up in UDF's (user-defined functions) To: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.9 tagged_above=0.0 required=5.0 tests=FROM_ENDS_IN_NUMS X-Spam-Level: X-Archive-Number: 200406/17 X-Sequence-Number: 4945 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/