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

From Martijn van Oosterhout
Subject Re: UPDATE w/ subselect doing locking
Date
Msg-id 20011116014319.C3148@svana.org
Whole thread Raw
In response to UPDATE w/ subselect doing locking  (David Ford <dford@erisksecurity.com>)
List pgsql-general
On Wed, Nov 14, 2001 at 02:34:51AM -0500, David Ford wrote:
> bluelist=> UPDATE spamcontrol SET count=foo.count+1 FROM (SELECT count
> FROM spamcontrol WHERE regex='setup fees' FOR UPDATE) as foo;
>
> How do I get it to only update that one row?

What's the problem with:

UPDATE spamcontrol SET count=count+1 WHERE regex='setup fees';

HTH,
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Idle in transaction ????
Next
From: "Jahro"
Date:
Subject: Postgres+Delphi