session level locks

Started by Jenny -over 22 years ago2 messages
#1Jenny -
nat_lazy@hotmail.com

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
thanks
Jenny

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jenny - (#1)
Re: session level locks

"Jenny -" <nat_lazy@hotmail.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