Re: Fix for pageinspect bug in PG 17

2024-12-18 Thread Michael Paquier
On Tue, Dec 17, 2024 at 06:01:39PM +0100, Tomas Vondra wrote: > I also considered introducing pg_stat_statements-style versioning, but > it's too late to do that in backbranches, and I don't think we expect > the function to change very often to justify this. Sounds good to me, thanks! -- Michael

Re: Fix for pageinspect bug in PG 17

2024-12-17 Thread Tomas Vondra
I've pushed (and backpatched) a fix for this. I ended up doing the simplest thing -- error out if the number of columns does not match, suggesting to update to latest extension version. I considered handling it in a nicer way, but I didn't like the result very much and I think that's sufficient f

RE: Fix for pageinspect bug in PG 17

2024-11-13 Thread Hayato Kuroda (Fujitsu)
Dear Tomas, Thanks for updating the patch. I've tested new patch and confirmed the brin_pgage_items() could error out: ``` postgres=# SELECT * FROM brin_page_items(get_raw_page('foo_id_idx', 2), 'foo_id_idx'); ERROR: function has wrong number of declared columns HINT: To resolve the problem,

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Michael Paquier
On Wed, Nov 13, 2024 at 07:54:03PM -0500, Peter Geoghegan wrote: > On Wed, Nov 13, 2024 at 7:48 PM Michael Paquier wrote: >> 691e8b2e18 is not something I would have done when it comes to >> pageinspect, FWIW. There is the superuser argument for this module, >> so I'd vote for an error and apply

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Peter Geoghegan
On Wed, Nov 13, 2024 at 3:00 PM Tomas Vondra wrote: > Does that mean you think we should fix the issue at hand differently? > Say, by looking at number of columns and building the correct tuple, > like I did in my initial patch? I don't feel strongly about it either way. But if it was my fix I'd

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Peter Geoghegan
On Wed, Nov 13, 2024 at 7:48 PM Michael Paquier wrote: > On Wed, Nov 13, 2024 at 09:00:30PM +0100, Tomas Vondra wrote: > > Does that mean you think we should fix the issue at hand differently? > > Say, by looking at number of columns and building the correct tuple, > > like I did in my initial pat

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Michael Paquier
On Wed, Nov 13, 2024 at 09:00:30PM +0100, Tomas Vondra wrote: > Does that mean you think we should fix the issue at hand differently? > Say, by looking at number of columns and building the correct tuple, > like I did in my initial patch? 691e8b2e18 is not something I would have done when it comes

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Tomas Vondra
On 11/13/24 18:20, Peter Geoghegan wrote: > On Wed, Nov 13, 2024 at 11:07 AM Tomas Vondra wrote: >> My plan was to apply the patch to both 17 and HEAD, and then maybe do >> something smarter in HEAD in a separate commit. But then Michael pointed >> out other pageinspect functions just error out

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Peter Geoghegan
On Wed, Nov 13, 2024 at 11:07 AM Tomas Vondra wrote: > My plan was to apply the patch to both 17 and HEAD, and then maybe do > something smarter in HEAD in a separate commit. But then Michael pointed > out other pageinspect functions just error out in this version-mismatch > cases, so I think it's

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Tomas Vondra
On 11/12/24 09:04, Hayato Kuroda (Fujitsu) wrote: > Dear Tomas, > >> Here's a fix for pageinspect bug in PG17, reported in [1]. The bug turns >> out to be introduced by my commit > > I could not see the link, but I think it is [1], right? > Right. Apologies, I forgot to include the link. >> >>

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Tomas Vondra
On 11/12/24 08:39, Michael Paquier wrote: > 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

RE: Fix for pageinspect bug in PG 17

2024-11-12 Thread Hayato Kuroda (Fujitsu)
Dear Tomas, > Here's a fix for pageinspect bug in PG17, reported in [1]. The bug turns > out to be introduced by my commit I could not see the link, but I think it is [1], right? > > commit dae761a87edae444d11a411f711f1d679bed5941 > Author: Tomas Vondra > Date: Fri Dec 8 17:07:30 2023 +0100

Re: Fix for pageinspect bug in PG 17

2024-11-11 Thread Michael Paquier
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 VER