Re: Fix for pageinspect bug in PG 17

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tomas Vondra <tomas(at)vondra(dot)me>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix for pageinspect bug in PG 17
Date: 2024-11-12 07:39:48
Message-ID: ZzMGRCCePgJq1HV4@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 11, 2024 at 07:32:10PM +0100, Tomas Vondra wrote:
> This adds an out argument to brin_page_items, but I failed to consider
> the user may still run with an older version of the extension - either
> after pg_upgrade (as in the report), or when the CREATE EXTENSION
> command specifies VERSION.

Perhaps it would be worth adding a test where the function is called
in the context of a past extension version? (I know, I'm noisy when
it comes to that.)

> The only fix I can think of is explicitly looking at TupleDesc->natts,
> as in the attached fix.

How about some consistency instead as this is the same error as
691e8b2e1889? btreefuncs.c is deciding to issue an error if we are
trying to call one of its functions in the context of a past version
of the extension. pageinspect is a superuser module, it does not seem
that bad to me to tell users that they should force an upgrade when
using it.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2024-11-12 07:45:23 Re: Support LIKE with nondeterministic collations
Previous Message Zhijie Hou (Fujitsu) 2024-11-12 07:22:27 RE: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY