Seaquel
PostgreSQL error code

PostgreSQL error 22034

22034 is the SQLSTATE PostgreSQL reports for more than one sql json item, in class 22, Data Exception.

SQLSTATE22034
Condition namemore_than_one_sql_json_item
Class22 — Data Exception

Reproduce it, then fix it

JSON_VALUE returns a single scalar, and this path matches two. JSON_QUERY with WITH WRAPPER returns them all as an array. Without ERROR ON ERROR, JSON_VALUE would quietly return NULL. Run the broken query to see the error, then switch to the fixed one. Edit either freely; every run is rolled back.

SELECT JSON_VALUE(jsonb '{"tags": ["sale", "new"]}', '$.tags[*]' ERROR ON ERROR);
SELECT JSON_QUERY(jsonb '{"tags": ["sale", "new"]}', '$.tags[*]' WITH WRAPPER);

Source: PostgreSQL documentation, Appendix A