X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E065F3CAB9E for ; Fri, 24 Dec 2004 22:18:53 +0000 (GMT) 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 82969-08 for ; Fri, 24 Dec 2004 22:18:41 +0000 (GMT) Received: from loki.globexplorer.com (unknown [208.35.14.101]) by svr1.postgresql.org (Postfix) with ESMTP id 59EEF3CAB97 for ; Fri, 24 Dec 2004 22:18:42 +0000 (GMT) content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Subject: Re: commit inside plpgsql function Date: Fri, 24 Dec 2004 14:18:42 -0800 Message-ID: <71E37EF6B7DCC1499CEA0316A256832801D4BC74@loki.wc.globexplorer.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] commit inside plpgsql function Thread-Index: AcTpy26/TDMmXKitQcaXpwfocjDsIgAOr6DW From: "Gregory S. Williamson" To: "Dennis Sacks" , X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/155 X-Sequence-Number: 19775 Already been answered (by me) -- you can't do this in postgres 7.x or = earlier -- procedures may not have begins/commits or rollbacks. Version = 8.0 *may* be different -- I don't have it installed yet; it does allow = for some nesting of transactions but I don't know if this is allowed. = The 8.0 documentation on user defined procedures would probably say. Greg Williamson DBA GlobeXplorer LLC -----Original Message----- From: Dennis Sacks [mailto:dennis@illusions.com] Sent: Tue 12/21/2004 9:21 AM To: pgsql-sql@postgresql.org Cc:=09 Subject: [SQL] commit inside plpgsql function Hi, I am converting oracle stored procedures to plpgsql. There are several=20 of the oracle procedures where a parameter vCommit is passed into the=20 procedure and: if vCommit =3D 1 then commit; do_something_commit(vdate); else do_something(vdate); end if; does this make sense in plpgsql? Does it make sense to do a commit in=20 plpgsql? Thanks, Dennis ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if = your joining column's datatypes do not match