postgres.git / summary / log / commit / refs

commit    45817676632b46fc9d2b97c8d432348e0ee4f1f4
Author:   Masahiko Sawada <msawada@postgresql.org>
Date:     Thu Aug 27 19:25:01 2026 +0000
First released in: 19.0

    Report next_multi_offset as bigint in pg_control_checkpoint().
    
    Commit bd8d9c9bdfa widened MultiXactOffset to 64 bits, but
    pg_control_checkpoint() still handle checkPointCopy.nextMultiOffset as
    xid type and declared next_multi_offset column as xid. Since xid is 32
    bits wide, an offset above 2^32 was reported truncated, while
    pg_controldata printed the full value of the same field.
    
    This commit reports the column as bigint instead. That matches
    pg_get_multixact_stats(), which already reports num_members and
    members_size, both derived from these same offsets, as int8.
    
    Backpatch to v19, where MultiXactOffset was widened.
    
    Bump catalog version.
    
    Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
    Reviewed-by: Chao Li <li.evan.chao@gmail.com>
    Discussion: https://postgr.es/m/CAD21AoCvzerscfU8o4ARQ793yAGHpQ72r2x5apeC_W2-k=SLCQ@mail.gmail.com
    Backpatch-through: 19


doc/src/sgml/func/func-info.sgml | 2 +- src/backend/utils/misc/pg_controldata.c | 2 +- src/include/catalog/catversion.h | 2 +- src/include/catalog/pg_proc.dat | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/func/func-info.sgml b/doc/src/sgml/func/func-info.sgml index e3c05e8b933..2f03766b67a 100644 --- a/doc/src/sgml/func/func-info.sgml +++ b/doc/src/sgml/func/func-info.sgml @@ -3458,7 +3458,7 @@ acl | {postgres=arwdDxtm/postgres,foo=r/postgres} <row> <entry><structfield>next_multi_offset</structfield></entry> - <entry><type>xid</type></entry> + <entry><type>bigint</type></entry> </row> <row> diff --git a/src/backend/utils/misc/pg_controldata.c b/src/backend/utils/misc/pg_controldata.c index ab74d169c96..9014f0953e9 100644 --- a/src/backend/utils/misc/pg_controldata.c +++ b/src/backend/utils/misc/pg_controldata.c @@ -130,7 +130,7 @@ pg_control_checkpoint(PG_FUNCTION_ARGS) values[9] = TransactionIdGetDatum(ControlFile->checkPointCopy.nextMulti); nulls[9] = false; - values[10] = TransactionIdGetDatum(ControlFile->checkPointCopy.nextMultiOffset); + values[10] = Int64GetDatum(ControlFile->checkPointCopy.nextMultiOffset); nulls[10] = false; values[11] = TransactionIdGetDatum(ControlFile->checkPointCopy.oldestXid); diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 31e49d5a8a7..f11e244899e 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -57,6 +57,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 202608183 +#define CATALOG_VERSION_NO 202608271 #endif diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 1d2a9db3262..6979c7d1161 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -12432,7 +12432,7 @@ descr => 'pg_controldata checkpoint state information as a function', proname => 'pg_control_checkpoint', provolatile => 'v', prorettype => 'record', proargtypes => '', - proallargtypes => '{pg_lsn,pg_lsn,text,int4,int4,bool,bool,text,oid,xid,xid,xid,oid,xid,xid,oid,xid,xid,int4,timestamptz}', + proallargtypes => '{pg_lsn,pg_lsn,text,int4,int4,bool,bool,text,oid,xid,int8,xid,oid,xid,xid,oid,xid,xid,int4,timestamptz}', proargmodes => '{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}', proargnames => '{checkpoint_lsn,redo_lsn,redo_wal_file,timeline_id,prev_timeline_id,full_page_writes,logical_decoding,next_xid,next_oid,next_multixact_id,next_multi_offset,oldest_xid,oldest_xid_dbid,oldest_active_xid,oldest_multi_xid,oldest_multi_dbid,oldest_commit_ts_xid,newest_commit_ts_xid,data_page_checksum_version,checkpoint_time}', prosrc => 'pg_control_checkpoint' }, [parent: 058962fdc98e]