pathat(at)comcast(dot)net (Patrick Hatcher) writes:
> Curious: Why would a DELETE FROM tablename work while a pg_dump is
> occurring but a TRUNCATE tablename will stay in a lock state until the
> pg_dump is complete?
DELETE FROM merely has to mark all the tuples as dead, which requires
no control over the table as a whole.
TRUNCATE essentially reinitializes the table as empty, which does need
a (if brief) lock on the table.
Yeah, you can't TRUNCATE while the dump is running...
(416) 673-4124 (land)
In response to
pgsql-general by date
|Next:||From: Vladimir S. Petukhov||Date: 2004-12-21 20:47:31|
|Subject: Re: Need help to organize database|
|Previous:||From: Greg Stark||Date: 2004-12-21 20:42:22|
|Subject: Re: Scheduler in Postgres|