When pg_dump captures a full backup, if we have sequences being updated, does pg_dump guarantee that the sequence values will be consistent when the export is being done? To elaborate, if pg_dump takes an hour to run, and if sequences are being updated, are the sequence values consistent with when the pg_dump was executed, or will it be the latest sequence values when pg_dump finishes?
We tried using the set isolation level from one session, and updated the sequence values from another.
BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
the above was executed from a session that was kept active. then from another session, we updated the sequences.
upon checking from the first session, we noticed that the tables that are being updated from the second session don’t get the latest changes when isolation level is set. However, the sequence values are the latest. What we’re trying to understand is whether pg_dump will have the same behavior or not.
Shiva is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.