public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: PetSerAl <[email protected]>
Cc: Guillaume Lelarge <[email protected]>
Cc: [email protected]
Subject: Re: pg_dump and not MVCC-safe commands
Date: Mon, 20 May 2024 10:24:02 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKygsHRBRUhjGAQtqnbYPaXxJPvN2J49yS4ceee62iVG_jcuQQ@mail.gmail.com>
References: <CAKygsHQHhd4rzYcNCd8OJMH46saT1E+9+5MT2CgOCGgf_yaQAw@mail.gmail.com>
<CAECtzeUQ3hJYPM6k6_XqZLq=DygHbQ3+5YQLrv-ngcht2rQjQg@mail.gmail.com>
<CAKygsHRBRUhjGAQtqnbYPaXxJPvN2J49yS4ceee62iVG_jcuQQ@mail.gmail.com>
PetSerAl <[email protected]> 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
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: pg_dump and not MVCC-safe commands
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox