Re: DELETE versus TRUNCATE during pg_dump....

Поиск
Список
Период
Сортировка
От Christopher Browne
Тема Re: DELETE versus TRUNCATE during pg_dump....
Дата
Msg-id 60is6vbcrj.fsf@dba2.int.libertyrms.com
обсуждение исходный текст
Ответ на DELETE versus TRUNCATE during pg_dump....  (Patrick Hatcher <pathat@comcast.net>)
Список pgsql-general
pathat@comcast.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...
--
"cbbrowne","@","ca.afilias.info"
<http://dev6.int.libertyrms.com/>
Christopher Browne
(416) 673-4124 (land)

В списке pgsql-general по дате отправления:

Предыдущее
От: Steve Wampler
Дата:
Сообщение: Re: New Fedora 3 install gives: relation "pg_catalog.pg_user"
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Need help to organize database