Re: locking a table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: a(dot)schmitz(at)cityweb(dot)de
Cc: Simone Tellini <tellini(at)areabusiness(dot)it>, pgsql-admin(at)postgresql(dot)org
Subject: Re: locking a table
Date: 2002-12-23 19:31:47
Message-ID: 7203.1040671907@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Andreas Schmitz <a(dot)schmitz(at)cityweb(dot)de> writes:
> Maybe I have a different idea of exclusive.

Locks are held till the end of the current transaction ... so you need
something like

begin;
lock ...;
do whatever ...;
commit;

to do anything useful with an explicit lock. A standalone LOCK command
will drop the lock as soon as it's acquired.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2002-12-23 19:45:59 Re: SSL Mode
Previous Message Radoslaw Stachowiak 2002-12-23 18:59:11 Re: SSL Mode