postgresql/src/backend
Tom Lane 50428a301d Change JsonSemAction to allow non-throw error reporting.
Formerly, semantic action functions for the JSON parser returned void,
so that there was no way for them to affect the parser's behavior.
That means in particular that they can't force an error exit except by
longjmp'ing.  That won't do in the context of our project to make input
functions return errors softly.  Hence, change them to return the same
JsonParseErrorType enum value as the parser itself uses.  If an action
function returns anything besides JSON_SUCCESS, the parse is abandoned
and that error code is returned.

Action functions can thus easily return the same error conditions that
the parser already knows about.  As an escape hatch for expansion, also
invent a code JSON_SEM_ACTION_FAILED that the core parser does not know
the exact meaning of.  When returning this code, an action function
must use some out-of-band mechanism for reporting the error details.

This commit simply makes the API change and causes all the existing
action functions to return JSON_SUCCESS, so that there is no actual
change in behavior here.  This is long enough and boring enough that
it seemed best to commit it separately from the changes that make
real use of the new mechanism.

In passing, remove a duplicate assignment of
transform_string_values_scalar.

Discussion: https://postgr.es/m/1436686.1670701118@sss.pgh.pa.us
2022-12-11 10:39:05 -05:00
..
access Allow DateTimeParseError to handle bad-timezone error messages. 2022-12-09 13:30:47 -05:00
backup Rename shadowed local variables 2022-10-05 21:01:41 +13:00
bootstrap Remove AssertArg and AssertState 2022-10-28 09:19:06 +02:00
catalog Add USER SET parameter values for pg_db_role_setting 2022-12-09 13:12:20 +03:00
commands Add USER SET parameter values for pg_db_role_setting 2022-12-09 13:12:20 +03:00
executor Remove unnecessary casts 2022-12-08 08:58:15 +01:00
foreign Rename SetSingleFuncCall() to InitMaterializedSRF() 2022-10-18 10:22:35 +09:00
jit Replace SQLValueFunction by COERCE_SQL_SYNTAX 2022-11-21 18:31:59 +09:00
lib Add doubly linked count list implementation 2022-11-02 14:06:05 +13:00
libpq Fix typo in hba.c 2022-11-26 10:14:18 +09:00
main Add workaround to make ubsan and ps_status.c compatible 2022-11-21 13:56:23 -08:00
nodes Create infrastructure for "soft" error reporting. 2022-12-09 09:58:38 -05:00
optimizer Add subquery pullup handling for WindowClause runCondition 2022-12-10 19:27:20 +13:00
parser Add USER SET parameter values for pg_db_role_setting 2022-12-09 13:12:20 +03:00
partitioning Move PartitioPruneInfo out of plan nodes into PlannedStmt 2022-12-01 12:56:21 +01:00
po meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
port Provide sigaction() for Windows. 2022-11-09 13:06:31 +13:00
postmaster Generate pg_stat_get*() functions for tables using macros 2022-12-06 10:46:35 +09:00
regex Remove uses of register due to incompatibility with C++17 and up 2022-09-24 12:08:37 -07:00
replication Avoid unnecessary streaming of transactions during logical replication. 2022-12-08 06:05:09 +05:30
rewrite Update outdated comment in ApplyRetrieveRule 2022-12-07 12:35:59 +01:00
snowball meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
statistics Stop accessing checkAsUser via RTE in some cases 2022-11-30 12:07:03 +01:00
storage Update types in File API 2022-12-08 08:58:15 +01:00
tcop Refactor aclcheck functions 2022-11-13 09:02:41 +01:00
tsearch Add comments and a missing CHECK_FOR_INTERRUPTS in ts_headline. 2022-11-21 17:07:29 -05:00
utils Change JsonSemAction to allow non-throw error reporting. 2022-12-11 10:39:05 -05:00
.gitignore
Makefile autoconf: Move export_dynamic determination to configure 2022-12-06 18:55:28 -08:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
meson.build meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
nls.mk NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00