Throw error in jsonb_path_match() when result is not single boolean
Alexander Korotkov <akorotkov@postgresql.org>
Throw error in jsonb_path_match() when result is not single boolean jsonb_path_match() checks if jsonb document matches jsonpath query. Therefore, jsonpath query should return single boolean. Currently, if result of jsonpath is not a single boolean, NULL is returned independently whether silent mode is on or off. But that appears to be wrong when silent mode is off. This commit makes jsonb_path_match() throw an error in this case. Author: Nikita Glukhov
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/jsonpath_exec.c | modified | +17 −9 |
| src/test/regress/expected/jsonb_jsonpath.out | modified | +51 −0 |
| src/test/regress/sql/jsonb_jsonpath.sql | modified | +12 −0 |