| From: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> | 
|---|---|
| To: | Evan Jones <ej(at)evanjones(dot)ca> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: Reasons to reorder results *within* a transaction? | 
| Date: | 2013-10-04 17:49:31 | 
| Message-ID: | 20131004174931.GX5235@eldon.alvh.no-ip.org | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
Evan Jones wrote:
> I *know* that without an ORDER BY clause, the database is free to
> reorder results in any way it likes. However, I recently ran into a
> case where the *SAME* query was returning results in a different order
> *within* a single transaction, which surprised me (we fixed it by
> adding the missing ORDER BY). I would assume that once a transaction
> obtains a snapshot, all its read operations would return the same
> results.
Yes, the same results -- not necessarily in the same order.  For
instance, a synchronized scan might start at a different point of the
table.
-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bruce Momjian | 2013-10-05 14:19:05 | Re: Major upgrade of PostgreSQL and MySQL | 
| Previous Message | Evan Jones | 2013-10-04 17:29:03 | Re: Reasons to reorder results *within* a transaction? |