From: Robert Haas Date: Fri, 28 Oct 2011 16:02:04 +0000 (-0400) Subject: Clarify that ORDER BY/FOR UPDATE can't malfunction at higher iso levels. X-Git-Tag: REL9_1_2~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af0cc0f42ddb79c842d3410f31b32de9477b71e3;p=thirdparty%2Fpostgresql.git Clarify that ORDER BY/FOR UPDATE can't malfunction at higher iso levels. Kevin Grittner --- diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml index 7fb52833e8a..f890ab2c835 100644 --- a/doc/src/sgml/ref/select.sgml +++ b/doc/src/sgml/ref/select.sgml @@ -1280,7 +1280,8 @@ ROLLBACK TO s; - It is possible for a SELECT command using ORDER + It is possible for a SELECT command running at the READ + COMMITTED transaction isolation level and using ORDER BY and FOR UPDATE/SHARE to return rows out of order. This is because ORDER BY is applied first. The command sorts the result, but might then block trying to obtain a lock @@ -1301,6 +1302,13 @@ SELECT * FROM (SELECT * FROM mytable FOR UPDATE) ss ORDER BY column1; only if concurrent updates of the ordering columns are expected and a strictly sorted result is required. + + + At the REPEATABLE READ or SERIALIZABLE + transaction isolation level this would cause a serialization failure (with + a SQLSTATE of '40001'), so there is + no possibility of receiving rows out of order under these isolation levels. +