Hi,

Thanks for the review, Fujii-san!

On Fri, 20 Nov 2026 at 21:13, Fujii Masao <[email protected]> wrote:
>
> On Sun, Sep 13, 2026 at 12:50 AM Ayush Tiwari
> <[email protected]> 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: v3-0001-Fix-internal-errors-reachable-from-SQL.patch
Description: Binary data

Reply via email to