Re: PL/pgsql locking policy

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Emberson <emberson(at)phc(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PL/pgsql locking policy
Date: 2002-03-25 08:07:00
Message-ID: 17605.1017043620@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2002-03-25 08:23:55 Re: Another notify question
Previous Message tony 2002-03-25 08:02:14 Register article