Skip site navigation (1) Skip section navigation (2)

Re: Question about isolation

From: Chester Kustarz <chester(at)arbor(dot)net>
To: Samuel Tardieu <sam(at)rfc1149(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Question about isolation
Date: 2004-01-28 20:12:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
On Wed, 28 Jan 2004, Samuel Tardieu wrote:
> If in a transaction I call an embedded function in Pl/PgSQL, in which
> I have:
>   delete from t where condition;
>   for e in select distinct on (f) * from t where ... loop
>      ...
>   end loop;
> Do I have the guarantee that, in any event, rows deleted from table t
> by the delete won't reappear in the select result?

i do not think you have that guarantee in READ COMMITTED mode because
there is a slight possibility another backend sneaked a committed insert in
between the delete and select statement. perhaps you want to
change to SERIALIZABLE transaction isolation. or perhaps you would
like to repeat the WHERE condition from the DELETE in the following
SELECT so as to not gather any of the offending rows.

In response to


pgsql-sql by date

Next:From: Chester KustarzDate: 2004-01-28 20:36:23
Subject: Re: Question about isolation
Previous:From: j knightDate: 2004-01-28 19:18:27
Subject: Re: Aggregate function error in 7.4

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group