Re: bugfix: when the blocksize is 32k, the function page_header of pageinspect returns negative numbers.

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Quan Zongliang <quanzongliang(at)yeah(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: bugfix: when the blocksize is 32k, the function page_header of pageinspect returns negative numbers.
Date: 2021-07-08 04:28:06
Message-ID: 20210708042806.GA22043@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 08, 2021 at 01:15:12PM +0900, Michael Paquier wrote:
> On Thu, Jul 08, 2021 at 09:12:26AM +0530, Bharath Rupireddy wrote:
> > +1. int32 makes sense because the maximum allowed block size is 32768
> > and smallint with range -32768 to +32767 can't hold it. Internally,
> > lower, upper, special are treated as unit16. I looked at the patch,
> > how about using "int4" instead of just "int", just for readability?
> > And, do we need to change in pageinspect--1.1--1.2.sql and
> > pageinspect--1.0--1.1.sql along with pageinspect--1.5.sql?
>
> Changes in the object set of an extension requires a new SQL script
> that changes the objects to reflect the change. So, in this case,
> what you need to do is to create pageinspect--1.9--1.10.sql, assuming
> that the new extension version is 1.10 and change page_header()
> accordingly.

I think it's common (and preferred) for changes in extension versions to be
"folded" together within a major release of postgres. Since v1.9 is new in
pg14 (commit 756ab2912), this change can be included in the same, new version.

> You also need to be careful about compatibility with past versions of
> this extension, as the code you are changing to use int8 could be used
> at runtime by older versions of pageinspect where int4 is used. I
> would suggest to test that with some new extra tests in
> oldextversions.sql.

I think you can refer to this prior commit for guidance.

commit f18aa1b203930ed28cfe42e82d3418ae6277576d
Author: Peter Eisentraut <peter(at)eisentraut(dot)org>
Date: Tue Jan 19 10:28:05 2021 +0100

pageinspect: Change block number arguments to bigint

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2021-07-08 04:29:58 Re: [PATCH] expand the units that pg_size_pretty supports on output
Previous Message Michael Paquier 2021-07-08 04:15:12 Re: bugfix: when the blocksize is 32k, the function page_header of pageinspect returns negative numbers.