Re: Read Committed Transaction Isolation and SELECT ... UNION ... SELECT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Eric Ridge <eebbrr(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Read Committed Transaction Isolation and SELECT ... UNION ... SELECT
Date: 2010-08-10 22:46:49
Message-ID: 20519.1281480409@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Eric Ridge <eebbrr(at)gmail(dot)com> writes:
> http://www.postgresql.org/docs/8.4/static/transaction-iso.html says:

> "Also note that two successive SELECT commands can see different data,
> even though they are within a single transaction, if other
> transactions commit changes during execution of the first SELECT."

> I get that what that means in normal cases, but what about a single
> query comprised of one or more unions:

> SELECT ... FROM foo WHERE ...
> UNION
> SELECT ... FROM foo WHERE ...

That's just one SELECT command. Sub-SELECTs inside a query don't
count as separate commands for this purpose; the use of SELECT in
that way is just an artifact of the SQL grammar.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2010-08-10 22:56:09 Re: pl/pgsql editor and postgres developemnt tool
Previous Message Eric Ridge 2010-08-10 22:24:39 Read Committed Transaction Isolation and SELECT ... UNION ... SELECT