Richard Emberson <emberson(at)phc(dot)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