SQL/JSON: Validate values in ON ERROR/EMPTY clauses

Amit Langote <amitlan@postgresql.org>

Commit: 55e56c84da99fe7becda2194563f48bb3083c2d1
Author: Amit Langote <amitlan@postgresql.org>
Date: 2024-06-28T05:01:43Z
Releases: 17.0
SQL/JSON: Validate values in ON ERROR/EMPTY clauses

Currently, the grammar allows any supported values in the ON ERROR
and ON EMPTY clauses for SQL/JSON functions, regardless of whether
the values are appropriate for the function. This commit ensures
that during parse analysis, the provided value is checked for
validity for the given function and throws a syntax error if it is
not.

While at it, this fixes some omissions in the documentation of the
ON ERROR/EMPTY clauses for JSON_TABLE().

Reported-by: Jian He <jian.universality@gmail.com>
Reviewed-by: Jian He <jian.universality@gmail.com>
Discussion: https://postgr.es/m/CACJufxFgWGqpESSYzyJ6tSurr3vFYBSNEmCfkGyB_dMdptFnZQ%40mail.gmail.com

Files

Documentation touched

Discussion