Re: BUG #19631: currtid2() on a view with GROUP BY ctid crashes with XX000

From: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Pierre Forstmann <pierre(dot)forstmann(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19631: currtid2() on a view with GROUP BY ctid crashes with XX000
Date: 2026-11-20 16:58:52
Message-ID: CAJTYsWWD5CmKWDCnnvO0cqytv6rT_Vvk_OBCwAbVyGCGTW6Opg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Hi,

Thanks for the review, Fujii-san!

On Fri, 20 Nov 2026 at 21:13, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>
> On Sun, Sep 13, 2026 at 12:50 AM Ayush Tiwari
> <ayushtiwari(dot)slg01(at)gmail(dot)com> wrote:
> > I've added it for now, but personally I don't think it is required.
>
> I agree that the additional test isn't necessary here.

Dropped it in v3.

> - (errmsg("Unicode categorization can only be performed if server
> encoding is UTF8")));
> + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
> + errmsg("Unicode categorization can only be performed if server
> encoding is UTF8")));
>
> unicode_norm_form_from_string() and str_casefold() have similar encoding
> checks, but use ERRCODE_SYNTAX_ERROR. I think
> ERRCODE_FEATURE_NOT_SUPPORTED is more appropriate, so I'd keep it here.
> Should we change those two checks to use it too?

Yeah, makes sense. In v1 I had picked ERRCODE_SYNTAX_ERROR to match
those two, and then only updated unicode_assigned() in v2. Changed both
to ERRCODE_FEATURE_NOT_SUPPORTED in v3 so all three UTF8 checks match.

> if (!crc_ok)
> ereport(ERROR,
> - (errmsg("calculated CRC checksum does not match value stored in file")));
> + (errcode(ERRCODE_DATA_CORRUPTED),
> + errmsg("calculated CRC checksum does not match value stored in file")));
>
> perform_base_backup() has the same control-file CRC check without
> an errcode(). Should we add ERRCODE_DATA_CORRUPTED there as well?

Ahh yeah, good catch. Added it there too (the remaining get_controlfile()
callers are all in frontend tools)..

Attached v3.

Regards,
Ayush

Attachment Content-Type Size
v3-0001-Fix-internal-errors-reachable-from-SQL.patch application/octet-stream 8.2 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Raja Sai pranav 2026-11-20 16:58:54 Re: BUG #19891: pg_restore ignores an explicitly empty -F argument
Previous Message Raja Sai pranav 2026-11-20 16:57:50 Re: BUG #19902: DECLARE CURSOR over trigger transition table fails with XX000

Browse pgsql-hackers by date

  From Date Subject
Next Message Gilles Darold 2026-11-20 16:59:09 Backpatch for fix simplehash to preserve consistency in case of OOM
Previous Message Robert Haas 2026-11-20 16:20:27 Re: log_postmaster_stats