Re: DELETE versus TRUNCATE during pg_dump....

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: DELETE versus TRUNCATE during pg_dump....
Дата
Msg-id 8201.1103644467@sss.pgh.pa.us
обсуждение исходный текст
Ответ на DELETE versus TRUNCATE during pg_dump....  (Patrick Hatcher <pathat@comcast.net>)
Ответы Re: DELETE versus TRUNCATE during pg_dump....
Re: DELETE versus TRUNCATE during pg_dump....
Список pgsql-general
Patrick Hatcher <pathat@comcast.net> 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?

TRUNCATE requires an exclusive lock on the table.

This is pretty much a no-free-lunch situation: if you want the pg_dump
to be able to dump all the rows that existed when it started, you can
hardly expect to be able to physically remove those rows meanwhile.

            regards, tom lane

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

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: RES: RES: NewsForge Poll: Favorite open source database
Следующее
От: "Vladimir S. Petukhov"
Дата:
Сообщение: Re: Need help to organize database