pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Wei Weng <wweng@kencast.com>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Is function atomic?
Date: 06 Jul 2001 14:17:39 -0400
Message-ID: <994443470.16301.2.camel@Monet> (raw)
In-Reply-To: <Pine.LNX.4.30.0107061844440.679-100000@peter.localdomain>
References: <Pine.LNX.4.30.0107061844440.679-100000@peter.localdomain>

What I wanted is simple:
I don't want other processes that run the function at the same time have
read/write access from the tables this function accesses(select and
insert/update). Is it possible, say, let other proccess blocked on this
function?

On 06 Jul 2001 18:49:49 +0200, Peter Eisentraut wrote:
> Wei Weng writes:
> 
> > Does that mean if I used
> > DECLARE
> > ...
> > BEGIN
> > DO_STUFF
> > END;
> >
> > the DO_STUFF will not be interrupted (maintain atomicity) even when
> > multiple threads use the function concurrently?
> 
> Interruption, atomicity, and concurrency are separate issues.  The
> function could of course be interrupted if there's an error.  (That error
> may be related to concurrency, such as a serialization failure.)  The
> database interactions of the function will be atomic in the sense that
> rollback will work.  Concurrent execution of a function is permitted, but
> there may be issues if you modify global state or there is a serialization
> failure.  These are the same issues that you have to deal with in any
> programming environment.
> 
> -- 
> Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://www.postgresql.org/search.mpl
> 

-- 
Wei Weng
Network Software Engineer
KenCast Inc.





view thread (11+ messages)  latest in thread

Message-ID: <994443470.16301.2.camel@Monet>
Permalink:  ../994443470.16301.2.camel@Monet/
Also on:    postgresql.org/message-id/994443470.16301.2.camel@Monet

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: wweng@kencast.com, peter_e@gmx.net
  Subject: Re: Is function atomic?
  In-Reply-To: <994443470.16301.2.camel@Monet>

* 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