pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix confusion about data type of pg_class.relpages and relallvis
Date: Mon, 24 Feb 2025 16:16:09 +0000
Message-ID: <E1tmb7p-000Tcd-1e@gemulon.postgresql.org> (raw)

Fix confusion about data type of pg_class.relpages and relallvisible.

Although they're exposed as int4 in pg_class, relpages and
relallvisible are really of type BlockNumber, that is uint32.
Correct type puns in relation_statistics_update() and remove
inappropriate range-checks.  The type puns are only cosmetic
issues, but the range checks would cause failures with huge
relations.

Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Author: Corey Huinker <corey.huinker@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/614341.1740269035@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9de2cc455eb9c60dda979c32985df967522a8ab2

Modified Files
--------------
src/backend/statistics/relation_stats.c | 53 ++++++++-------------------------
1 file changed, 13 insertions(+), 40 deletions(-)



Message-ID: <E1tmb7p-000Tcd-1e@gemulon.postgresql.org>
Permalink:  ../E1tmb7p-000Tcd-1e@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tmb7p-000Tcd-1e@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix confusion about data type of pg_class.relpages and relallvis
  In-Reply-To: <E1tmb7p-000Tcd-1e@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox