From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve error messages in parse_jsonb_index_flags().
Date: Wed, 18 Nov 2026 03:12:21 +0000
Message-ID: <E1xTW5s-00000000Azh-1y8s@gemulon.postgresql.org> (raw)
Improve error messages in parse_jsonb_index_flags().
Some of the error messages in this function weren't very well
thought out. They mistook reachable cases for unreachable ones,
and complained in words that were actually exactly backward from
the condition they'd detected, and weren't helpful anyway.
Since this is just substituting better error text and a better
SQLSTATE for what was there before, I don't feel a strong need
to back-patch.
Bug: #19910
Reported-by: Zheng Hacker <hackerzheng666@gmail.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19910-24199f8af1474753@postgresql.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9b937d1d1d0c54e24280967ba1dd11aff66d1486
Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c | 13 +++++++++----
src/test/regress/expected/json.out | 3 ++-
src/test/regress/expected/jsonb.out | 3 ++-
3 files changed, 13 insertions(+), 6 deletions(-)
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: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Improve error messages in parse_jsonb_index_flags().
In-Reply-To: <E1xTW5s-00000000Azh-1y8s@gemulon.postgresql.org>
References: <E1xTW5s-00000000Azh-1y8s@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