pgsql: Improve error messages of input functions for pg_dependencies an

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Improve error messages of input functions for pg_dependencies an
Date: 2025-12-08 01:24:19
Message-ID: E1vSPz8-003LrJ-1m@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve error messages of input functions for pg_dependencies and pg_ndistinct

The error details updated in this commit can be reached in the
regression tests. They did not follow the project style, and they
should be written them as full sentences.

Some of the errors are switched to use an elog(), for cases that involve
paths that cannot be reached based on the previous state of the parser
processing the input data (array start, object end, etc.). The error
messages for these cases use now a more consistent style across the
board, with the state of the parser reported for debugging.

Reported-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Author: Michael Paquier <michael(at)paquier(dot)xyz>
Co-authored-by: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Discussion: https://postgr.es/m/1353179.1764901790@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f68597ee777d0a177e84cf86b8386ea51c66b52e

Modified Files
--------------
src/backend/utils/adt/pg_dependencies.c | 59 ++++----
src/backend/utils/adt/pg_ndistinct.c | 53 +++----
src/test/regress/expected/pg_dependencies.out | 196 +++++++++++++-------------
src/test/regress/expected/pg_ndistinct.out | 160 ++++++++++-----------
4 files changed, 227 insertions(+), 241 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-12-08 03:46:34 pgsql: injection_points: Remove portions related to custom pgstats
Previous Message Tom Lane 2025-12-07 19:32:56 pgsql: ecpg: refactor to eliminate cast-away-const in find_variable().