Re: pg_dump and not MVCC-safe commands

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_dump and not MVCC-safe commands
Дата
Msg-id 3508051.1716215042@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_dump and not MVCC-safe commands  (PetSerAl <petseral@gmail.com>)
Ответы Re: pg_dump and not MVCC-safe commands
Список pgsql-general
PetSerAl <petseral@gmail.com> writes:
> My question:
> What happens if not MVCC-safe command committed after snapshot but before lock?

Then you'd get a dump that's not exactly consistent with the state
at the time of the snapshot.  However, it would be the very same
database state that any other query would see at that time.  So
if it's functionally inconsistent for your purposes, then you brought
that on your own head by using TRUNCATE concurrently with other
operations.

The other thing I can think of that's a hazard in this area is
that pg_dump will record current values of sequence objects that
may be advanced beyond where the sequence was at the instant of
the snapshot, since nextval() isn't MVCC-safe.  There are a lot
of other ways (rollbacks and crashes) in which a sequence can get
advanced beyond the last derived value you can find in the database,
so an application that finds this to be unacceptable should probably
not be using sequences.

            regards, tom lane



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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Updating 457 rows in a table
Следующее
От: PetSerAl
Дата:
Сообщение: Re: pg_dump and not MVCC-safe commands