Received: from nghost.vosn.net (unknown [157.238.46.43]) by postgresql.org (Postfix) with ESMTP id B8572475904 for ; Wed, 27 Feb 2002 17:04:10 -0500 (EST) Received: from cpe000094c6dc29.cpe.net.cable.rogers.com ([24.112.104.3] helo=broadswd) by nghost.vosn.net with asmtp (Exim 3.34 #1) id 16gCBH-0004sZ-00; Wed, 27 Feb 2002 17:04:12 -0500 From: "Arguile" To: "Chris Pesko" , Subject: Re: transactions and cursors...... Date: Wed, 27 Feb 2002 17:03:09 -0500 Message-ID: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <4.3.2.7.2.20020227092743.0306bb40@mailhost.organic.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - nghost.vosn.net X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [0 0] X-AntiAbuse: Sender Address Domain - lucentstudios.com X-Archive-Number: 200202/376 X-Sequence-Number: 3529 Chris Pesko writes: > Can I put transactions and cursors into functions? As soon as I > put BEGIN; > and COMMIT; wrapping an insert statement within a function, I get > errors. Do these programs need to reside outside of the database? Pg doesn't supported nested transactions or save points (yet). So you can't have transactional control inside plpgsql functions. Cursors will depend on what version you're running. See chapter 23.7 of the 7.2 documentation for using cursors inside functions. http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/plpgsql-cursors. html