aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/json.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2020-01-29 10:19:24 -0500
committerRobert Haas <rhaas@postgresql.org>2020-01-29 10:22:51 -0500
commitbeb4699091e9fab1c5f465056bef35c9ddf7f9fc (patch)
tree49206e96c8840b42e6462cfed38302e03cd9130c /src/backend/utils/adt/json.c
parentdc788668bb269b10a108e87d14fefd1b9301b793 (diff)
downloadpostgresql-beb4699091e9fab1c5f465056bef35c9ddf7f9fc.tar.gz
postgresql-beb4699091e9fab1c5f465056bef35c9ddf7f9fc.zip
Move jsonapi.c and jsonapi.h to src/common.
To make this work, (1) makeJsonLexContextCstringLen now takes the encoding to be used as an argument; (2) check_stack_depth() is made to do nothing in frontend code, and (3) elog(ERROR, ...) is changed to pg_log_fatal + exit in frontend code. Mark Dilger, reviewed and slightly revised by me. Discussion: http://postgr.es/m/CA+TgmoYfOXhd27MUDGioVh6QtpD0C1K-f6ObSA10AWiHBAL5bA@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/json.c')
-rw-r--r--src/backend/utils/adt/json.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c
index f6cd2b99115..567eab1e01e 100644
--- a/src/backend/utils/adt/json.c
+++ b/src/backend/utils/adt/json.c
@@ -127,7 +127,7 @@ json_recv(PG_FUNCTION_ARGS)
str = pq_getmsgtext(buf, buf->len - buf->cursor, &nbytes);
/* Validate it. */
- lex = makeJsonLexContextCstringLen(str, nbytes, false);
+ lex = makeJsonLexContextCstringLen(str, nbytes, GetDatabaseEncoding(), false);
pg_parse_json_or_ereport(lex, &nullSemAction);
PG_RETURN_TEXT_P(cstring_to_text_with_len(str, nbytes));