Re: Default Access Exclusive Lock on Update?

From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Default Access Exclusive Lock on Update?
Date: 2006-03-03 02:35:05
Message-ID: 873bi0qmqu.fsf@wolfe.cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Centuries ago, Nostradamus foresaw when seth(dot)m(dot)green(at)gmail(dot)com would write:
> For anyone that is interested, my problem was solved on another list.
> Turns out the TRUNCATE command that I run at the beginning of the SP
> creates and holds an access exclusive lock on the table for the entire
> duration of the SP. I changed it to DELETE FROM and my problem was
> fixed.

I was thinking of mentioning it; didn't think to...

By the way, if you're taking the approach of emptying the table out
entirely this way, you'll want to either:

a) Vacuum the table each time, or
b) Make sure you do use TRUNCATE once in a while

Otherwise the number of dead tuples will grow ungraciously, and you'll
find efficiency drops :-(.
--
wm(X,Y):-write(X),write('@'),write(Y). wm('cbbrowne','gmail.com').
http://linuxdatabases.info/info/slony.html
Inclusion of very old messages from others makes for an impressive show.
-- from the Symbolics Guidelines for Sending Mail

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Browne 2006-03-03 02:40:17 Re: Solaris 10 ZFS Postgresql request for comments
Previous Message Tom Lane 2006-03-03 00:29:13 Re: ERROR: column "datpath" does not exist