postgresql/src/common
Michael Paquier b44669b2ca Simplify error handing of jsonapi.c for the frontend
This commit removes a dependency to the central logging facilities in
the JSON parsing routines of src/common/, which existed to log errors
when seeing error codes that do not match any existing values in
JsonParseErrorType, which is not something that should never happen.

The routine providing a detailed error message based on the error code
is made backend-only, the existing code being unsafe to use in the
frontend as the error message may finish by being palloc'd or point to a
static string, so there is no way to know if the memory of the message
should be pfree'd or not.  The only user of this routine in the frontend
was pg_verifybackup, that is changed to use a more generic error message
on parsing failure.

Note that making this code more resilient to OOM failures if used in
shared libraries would require much more work as a lot of code paths
still rely on palloc() & friends, but we are not sure yet if we need to
go down to that.  Still, removing the dependency to logging is a step
toward more portability.

This cleans up the handling of check_stack_depth() while on it, as it
exists only in the backend.

Per discussion with Jacob Champion and Tom Lane.

Discussion: https://postgr.es/m/YNwL7kXwn3Cckbd6@paquier.xyz
2021-07-02 09:35:12 +09:00
..
unicode Update copyright for 2021 2021-01-02 13:06:25 -05:00
.gitignore Replace the data structure used for keyword lookup. 2019-01-06 17:02:57 -05:00
archive.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
base64.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
checksum_helper.c Add result size as argument of pg_cryptohash_final() for overflow checks 2021-02-15 10:18:34 +09:00
config_info.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
controldata_utils.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
cryptohash.c Add result size as argument of pg_cryptohash_final() for overflow checks 2021-02-15 10:18:34 +09:00
cryptohash_openssl.c Add result size as argument of pg_cryptohash_final() for overflow checks 2021-02-15 10:18:34 +09:00
d2s.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
d2s_full_table.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
d2s_intrinsics.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
digit_table.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
encnames.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
exec.c Factor out system call names from error messages 2021-04-23 14:21:37 +02:00
f2s.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
fe_memutils.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
file_perm.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
file_utils.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
hashfn.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
hex.c Adjust locations which have an incorrect copyright year 2021-06-04 12:19:50 +12:00
hmac.c Adjust locations which have an incorrect copyright year 2021-06-04 12:19:50 +12:00
hmac_openssl.c Adjust locations which have an incorrect copyright year 2021-06-04 12:19:50 +12:00
ip.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
jsonapi.c Simplify error handing of jsonapi.c for the frontend 2021-07-02 09:35:12 +09:00
keywords.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
kwlookup.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
link-canary.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
logging.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
Makefile Refactor HMAC implementations 2021-04-03 17:30:49 +09:00
md5.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
md5_common.c Add result size as argument of pg_cryptohash_final() for overflow checks 2021-02-15 10:18:34 +09:00
md5_int.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_get_line.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_lzcompress.c Fix typos and grammar in comments and docs 2021-04-19 11:32:30 +09:00
pgfnames.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
protocol_openssl.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
psprintf.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
relpath.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
restricted_token.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
rmtree.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
ryu_common.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
saslprep.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
scram-common.c Refactor HMAC implementations 2021-04-03 17:30:49 +09:00
sha1.c Adjust locations which have an incorrect copyright year 2021-06-04 12:19:50 +12:00
sha1_int.h Adjust locations which have an incorrect copyright year 2021-06-04 12:19:50 +12:00
sha2.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
sha2_int.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
sprompt.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
string.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
stringinfo.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
unicode_norm.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
username.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
wait_error.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
wchar.c Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00