pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: " <Miguel Sofer" <mig@utdt.edu>
To: pgsql-sql@postgresql.org
Subject: Transactions and functions
Date: Fri, 10 Dec 1999 10:35:48 -0300
Message-ID: <199912101335.KAA07281@ant.utdt> (raw)

I have read (in the manual? Can't remember ...) that you cannot BEGIN
a transaction in the body of a CREATE FUNCTION (at least for pltcl
functions - I seem to remember it has something to do with the SPI
interface, so that I assume it is true for any other user defined
function).

As I want to do some work within such a function, and I do need the
transaction to be protected from concurrent access by other users, I
am wondering how to do this.

Specifically, the question is: does a single SQL statement of the form 
   SELECT myFunction()
constitute a transaction, even if it involves multiple SQL statements
and SPI calls within the function definition? 

Assuming the answer to the previous question is 'yes': how can I
insure that the transaction isolation level is set to SERIALIZABLE? Do
I have to do it from the calling application, or is there a way to let
the function itself set the required isolation level?

Thanks

Miguel Sofer



Message-ID: <199912101335.KAA07281@ant.utdt>
Permalink:  ../199912101335.KAA07281@ant.utdt/
Also on:    postgresql.org/message-id/199912101335.KAA07281@ant.utdt

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: Miguel Sofer" <mig@utdt.edu
  Subject: Re: Transactions and functions
  In-Reply-To: <199912101335.KAA07281@ant.utdt>
  References: <199912101335.KAA07281@ant.utdt>

* 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