Re: Select for insert possible? - Mailing list pgsql-general

From Tom Lane
Subject Re: Select for insert possible?
Date
Msg-id 11210.985537707@sss.pgh.pa.us
Whole thread Raw
In response to Re: Select for insert possible?  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-general
Lincoln Yeoh <lyeoh@pop.jaring.my> writes:
> So I'll use "lock table" (this time in exclusive mode :) ), then select for
> update, then insert|update and leave the unique index to trigger an error
> when I forget to all that correctly, in which case it's definitely an error.

If you're holding an exclusive-mode lock then there's no need to do the
select FOR UPDATE; there can be no other lock holder.

            regards, tom lane

pgsql-general by date:

Previous
From: "Christian Marschalek"
Date:
Subject: RE: Views...
Next
From: Boris
Date:
Subject: Some interesting errorcodes (FreeBSD) PG 7.1 from cvs