Re: UPDATE w/ subselect doing locking - Mailing list pgsql-general

From David Ford
Subject Re: UPDATE w/ subselect doing locking
Date
Msg-id 3BF3F773.6060400@blue-labs.org
Whole thread Raw
In response to UPDATE w/ subselect doing locking  (David Ford <dford@erisksecurity.com>)
Responses Re: UPDATE w/ subselect doing locking  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: UPDATE w/ subselect doing locking  (Brent Verner <brent@rcfile.org>)
List pgsql-general
Yes, I know that works.  I want to figure out how to use SELECT ... FOR
UPDATE with UPDATE because I will have a need to lock these certain rows
and do a bit more than just 'count'.

Thank you,
David

Marc SCHAEFER wrote:

>On Wed, 14 Nov 2001, David Ford wrote:
>
>>bluelist=> UPDATE spamcontrol SET count=foo.count+1 FROM (SELECT count
>>FROM spamcontrol WHERE regex='setup fees' FOR UPDATE) as foo;
>>
>
>You want to increment atomically the count of the row where regex is setup
>fees ?
>
>UPDATE spamcontrol SET count = count + 1 WHERE regex = 'setup fees';
>



pgsql-general by date:

Previous
From: "Steve Wolfe"
Date:
Subject: Re: Postgres+Delphi
Next
From: "Svenne Krap"
Date:
Subject: userauth and hosting