Re: BUG #5129: LIMIT not correct. - Mailing list pgsql-bugs

From Andres Freund
Subject Re: BUG #5129: LIMIT not correct.
Date
Msg-id 200910211159.03544.andres@anarazel.de
Whole thread Raw
In response to BUG #5129: LIMIT not correct.  ("Thach Anh Tran" <myquartz@gmail.com>)
Responses Re: BUG #5129: LIMIT not correct.
List pgsql-bugs
On Wednesday 21 October 2009 05:37:36 Thach Anh Tran wrote:
> The following bug has been logged online:
>
> Bug reference:      5129
> Logged by:          Thach Anh Tran
> Email address:      myquartz@gmail.com
> PostgreSQL version: 8.3.8
> Operating system:   Linux
> Description:        LIMIT not correct.
> Details:
>
> the LIMIT clause is not reply correct number of rows and rows returns.
Read the second caution block in the relevant section of the manual:
http://www.postgresql.org/docs/current/interactive/sql-select.html#SQL-FOR-
UPDATE-SHARE


"It is possible for a SELECT command using both LIMIT and FOR UPDATE/SHARE
clauses to return fewer rows than specified by LIMIT. This is because LIMIT  is
applied first. The command selects the specified number of rows, but might then
block trying to obtain a lock on one or more of them. Once the SELECT
unblocks, the row might have been deleted or updated so that it does not meet
the query WHERE condition anymore, in which case it will not be returned.
"

Andres

pgsql-bugs by date:

Previous
From: Dave Page
Date:
Subject: Re: Re: BUG #5065: pg_ctl start fails as administrator, with "could not locate matching postgres executable"
Next
From: Dave Page
Date:
Subject: Re: Re: BUG #5065: pg_ctl start fails as administrator, with "could not locate matching postgres executable"