Re: Does PERFORM hold a lock?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Peter Headland <pheadland(at)actuate(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Does PERFORM hold a lock?
Date: 2009-08-11 20:10:48
Message-ID: 20090811201048.GE16362@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Headland wrote:
> If I do the following in a pl/pgsql function, will an update lock be
> held until the end of the transaction?
>
> PERFORM c FROM t FOR UPDATE;

Yes. (PERFORM is translated to SELECT by the plpgsql engine, so to the
SQL executor this is the same as SELECT FOR UPDATE).

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Headland 2009-08-11 20:13:05 Re: Race hazard deleting using CTID?
Previous Message Tom Lane 2009-08-11 19:00:52 Re: Race hazard deleting using CTID?