Re: wrong sequence value in dump file

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fabrice Chapuis <fabrice636861(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: wrong sequence value in dump file
Date: 2025-07-16 15:06:17
Message-ID: 1245511.1752678377@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fabrice Chapuis <fabrice636861(at)gmail(dot)com> writes:
> When dumping with pg_dump and the directory option, I got a sequence value
> that is greater in the dump file than the sequence in the source database.

Perhaps you were dumping from a standby server? It's normal for
a standby to show a value up to 32 counts more than the primary,
because of some tricks that sequence.c plays to reduce the number
of WAL records generated for nextval().

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-07-16 15:24:17 Re: Explicitly enable meson features in CI
Previous Message Andres Freund 2025-07-16 14:58:36 Re: Read-Write optimistic lock (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)