Re: session level locks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jenny -" <nat_lazy(at)hotmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: session level locks
Date: 2003-08-08 19:48:50
Message-ID: 29384.1060372130@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Jenny -" <nat_lazy(at)hotmail(dot)com> writes:
> hi, does anyone know what session level locks mean in postgresql..i've heard
> of table-level locks and row level locks but not session level

It's a hack for VACUUM. VACUUM needs to run two transactions to
vacuum both a table and its toast table; plus another one if it's
going to ANALYZE. Ordinary locks would go away at transaction
commit. Session locks are used to ensure the table doesn't disappear
till we're done vacuuming.

I doubt that session locks as currently designed are good for anything
except VACUUM. They *do* go away on error abort --- which is exactly
what VACUUM wants, but is unlikely to be useful behavior for anything
else.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-08-08 19:49:36 Re: LOCK.tag(figuring out granularity of lock)
Previous Message Alvaro Herrera 2003-08-08 19:42:52 Re: LOCK.tag(figuring out granularity of lock)