Re: pg_dump and not MVCC-safe commands - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_dump and not MVCC-safe commands
Date
Msg-id 3508051.1716215042@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump and not MVCC-safe commands  (PetSerAl <petseral@gmail.com>)
Responses Re: pg_dump and not MVCC-safe commands
List 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 by date:

Previous
From: Rich Shepard
Date:
Subject: Re: Updating 457 rows in a table
Next
From: PetSerAl
Date:
Subject: Re: pg_dump and not MVCC-safe commands