Re: select ... for update limit 1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: select ... for update limit 1
Date: 2001-02-19 05:51:50
Message-ID: 21160.982561910@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my> writes:
> Right now select for update limit 1 seems to lock all rows in the where
> clause, not just retrieved rows.

This claim surprises me quite a lot, since the FOR UPDATE locking occurs
at the outer level of the executor where rows are about to be returned.
And I can't duplicate your result in a simple test. Could you post a
reproducible example?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ronnie Esguerra 2001-02-19 05:59:20 FW: Dbf to Pg converter
Previous Message Tom Lane 2001-02-19 05:42:32 Re: Re: I've followed the faq and still getting too many clients errr