Skip to content

What about consider using 64bit for segment size? #38

@mrdrivingduck

Description

@mrdrivingduck

Hi~ The default relsegsize of PostgreSQL is 1GB so that it can be stored safely in an unsigned int. However, for some Postgres variant which is running on cloud storage, in order not to generate too many files for a relation, the relsegsize will be set to a larger number, which may overflow uint32, if relsegsize is larger than 4GB.

/* Segment size in bytes */
static unsigned int segmentSize = RELSEG_SIZE * BLCKSZ;

I got this warning:

pg_filedump.c:73:47: warning: overflow in expression; result is 0 with type 'int' [-Winteger-overflow]

How about use 64-bit unsigned integer for it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions