Re: Issues with blocksize smaller than 8KB - Mailing list pgsql-bugs

From Álvaro Herrera
Subject Re: Issues with blocksize smaller than 8KB
Date
Msg-id 202510191805.352ktu7f4xp5@alvherre.pgsql
Whole thread Raw
In response to Re: Issues with blocksize smaller than 8KB  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Issues with blocksize smaller than 8KB
List pgsql-bugs
On 2025-Oct-18, Tom Lane wrote:

> > 2025-10-17 15:39:13.182 UTC [97433] DETAIL:  The database cluster was initialized with RELSEG_SIZE 1895825408, but
theserver was compiled with RELSEG_SIZE 1895825408.
 
> > 2025-10-17 15:39:13.182 UTC [97433] HINT:  It looks like you need to recompile or initdb.
> 
> I could not reproduce any of these misbehaviors here.

Hmm, but how come two values that print identical result in failing the
test that they are not equal?  The involved code is this:

    if (ControlFile->relseg_size != RELSEG_SIZE)
        ereport(FATAL,
                (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
                 errmsg("database files are incompatible with server"),
        /* translator: %s is a variable name and %d is its value */
                 errdetail("The database cluster was initialized with %s %d,"
                           " but the server was compiled with %s %d.",
                           "RELSEG_SIZE", ControlFile->relseg_size,
                           "RELSEG_SIZE", RELSEG_SIZE),
                 errhint("It looks like you need to recompile or initdb.")));

where ControlFile->relseg_size is uint32 and RELSEG_SIZE is defined in
my pg_config.h as
#define RELSEG_SIZE 131072
which would be a signed quantity ... of what size again?  The value 1895825408
should fit in a signed int32 (if snugly).  I wonder whether something is
going awry with that.

What sort of platform is this on, anyway?

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/



pgsql-bugs by date:

Previous
From: Casey & Gina
Date:
Subject: Re: Issues with blocksize smaller than 8KB
Next
From: Tom Lane
Date:
Subject: Re: Issues with blocksize smaller than 8KB