aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ruleutils.c
diff options
context:
space:
mode:
authorAmit Langote <amitlan@postgresql.org>2024-09-06 13:25:14 +0900
committerAmit Langote <amitlan@postgresql.org>2024-09-06 13:25:53 +0900
commitbbd4c058a89b1e756eb646af89a4ef90f0df144e (patch)
tree087f5ea4c623fed7c8e5466e77d2e2e8e4eca27b /src/backend/utils/adt/ruleutils.c
parentee75a03f37fc27c7f07a21dc22edf4511e31a4a1 (diff)
downloadpostgresql-bbd4c058a89b1e756eb646af89a4ef90f0df144e.tar.gz
postgresql-bbd4c058a89b1e756eb646af89a4ef90f0df144e.zip
SQL/JSON: Fix default ON ERROR behavior for JSON_TABLE
Use EMPTY ARRAY instead of EMPTY. This change does not affect the runtime behavior of JSON_TABLE(), which continues to return an empty relation ON ERROR. It only alters whether the default ON ERROR behavior is shown in the deparsed output. Reported-by: Jian He <jian.universality@gmail.com> Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com Backpatch-through: 17
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r--src/backend/utils/adt/ruleutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 371b46e7a2d..cd9c3eddd1d 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -11875,7 +11875,7 @@ get_json_table(TableFunc *tf, deparse_context *context, bool showimplicit)
get_json_table_columns(tf, castNode(JsonTablePathScan, tf->plan), context,
showimplicit);
- if (jexpr->on_error->btype != JSON_BEHAVIOR_EMPTY)
+ if (jexpr->on_error->btype != JSON_BEHAVIOR_EMPTY_ARRAY)
get_json_behavior(jexpr->on_error, context, "ERROR");
if (PRETTY_INDENT(context))