Re: PL/pgsql locking policy - Mailing list pgsql-general

From Tom Lane
Subject Re: PL/pgsql locking policy
Date
Msg-id 17605.1017043620@sss.pgh.pa.us
Whole thread Raw
In response to PL/pgsql locking policy  (Richard Emberson <emberson@phc.net>)
List pgsql-general
Richard Emberson <emberson@phc.net> writes:
> If you have a PL/pgsql procedure that first reads from a given table to
> verify a condition and
> then if the condition is true write to that same table ... and at the
> same time you want other
> processes to be able to simply read from the table, what is the best
> locking policy within the procedure?

You could use EXCLUSIVE lock mode, which blocks everything except SELECT.

            regards, tom lane

pgsql-general by date:

Previous
From: tony
Date:
Subject: Register article
Next
From: Jeff Davis
Date:
Subject: Re: Another notify question