Received: from mail.rdc1.sdca.home.com (imail@ha1.rdc1.sdca.home.com [24.0.3.66]) by hub.org (8.10.1/8.10.1) with ESMTP id e8SIT9p72303 for ; Thu, 28 Sep 2000 14:29:09 -0400 (EDT) Received: from tajar ([24.1.6.224]) by mail.rdc1.sdca.home.com (InterMail vM.4.01.03.00 201-229-121) with SMTP id <20000928182905.GNIQ15602.mail.rdc1.sdca.home.com@tajar> for ; Thu, 28 Sep 2000 11:29:05 -0700 From: Forest Wilkinson To: pgsql-sql@hub.org Subject: transactions surrounding extension functions Date: Thu, 28 Sep 2000 11:30:20 -0700 Message-ID: X-Mailer: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200009/228 According to the postgres 7 docs: >By default, Postgres executes transactions in unchained mode (also >known as “autocommit” in other database systems). In other words, each >user statement is executed in its own transaction and a commit is >implicitly performed at the end of the statement (if execution was >successful, otherwise a rollback is done). Does this mean that when I call a function I wrote, which is composed of several queries, each of those queries will be executed in its own transaction? Or, will the statement containing the function call be executed in its own transaction, thereby including all the queries composing my function in that same transaction? This is important when I have a function that performs a SELECT...FOR UPDATE, followed by an UPDATE to the selected rows. If I call that function without surrounding it with BEGIN and END, the former behavior would be dangerous, while the latter behavior would be desirable. Thanks, Forest Wilkinson