pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve SQLSTATE reporting for several error conditions
Date: Tue, 24 Nov 2026 11:44:51 +0000
Message-ID: <E1xVox8-000000008Uw-2YAu@gemulon.postgresql.org> (raw)

Improve SQLSTATE reporting for several error conditions

currtid2() could report internal_error for unsupported views, such as
those grouping by ctid. These are valid views that the function cannot
handle, so use the more appropriate feature_not_supported, matching
the other unsupported-view checks.

Assign appropriate SQLSTATEs to several other errors involving
non-UTF8 server encodings, control file CRC mismatches, invalid GiST
tuples, and attempts to refresh the default collation's version.
Also replace syntax_error with feature_not_supported for the encoding
checks in Unicode normalization and case folding, since these reject
an unsupported database encoding rather than invalid SQL syntax.

Do not backpatch, to avoid changing SQLSTATEs in released branches.

Bug: #19631
Reported-by: Zheng Wang <hackerzheng666@gmail.com>
Reported-by: Yanjie Zhao
Reported-by: Yiyang Liu
Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Reviewed-by: Pierre Forstmann <pierre.forstmann@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/19631-b443dd6cd8d4e40b@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9ebc9a458c38465cd9609814cfc9ca3a2f46fef5

Modified Files
--------------
src/backend/access/gist/gist.c          |  3 ++-
src/backend/backup/basebackup.c         |  3 ++-
src/backend/commands/collationcmds.c    |  3 ++-
src/backend/utils/adt/formatting.c      |  2 +-
src/backend/utils/adt/tid.c             |  4 +++-
src/backend/utils/adt/varlena.c         |  5 +++--
src/backend/utils/misc/pg_controldata.c | 12 ++++++++----
7 files changed, 21 insertions(+), 11 deletions(-)



Message-ID: <E1xVox8-000000008Uw-2YAu@gemulon.postgresql.org>
Permalink:  ../E1xVox8-000000008Uw-2YAu@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xVox8-000000008Uw-2YAu@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org
  Subject: Re: pgsql: Improve SQLSTATE reporting for several error conditions
  In-Reply-To: <E1xVox8-000000008Uw-2YAu@gemulon.postgresql.org>
  References: <E1xVox8-000000008Uw-2YAu@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox