Does PERFORM hold a lock?

Started by Peter Headlandover 16 years ago2 messagesgeneral
Jump to latest
#1Peter Headland
pheadland@actuate.com

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;

--
Peter Headland
Architect
Actuate Corporation

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Peter Headland (#1)
Re: Does PERFORM hold a lock?

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.