Re: BUG #19737: Empty `JSON_OBJECT` cannot use documented `ON NULL` or unique-key clauses

From: Nitin Motiani <nitinmotiani(at)google(dot)com>
To: Narayanan Venkateswaran <narayananvpostgres(at)gmail(dot)com>
Cc: theshallow27(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Subject: Re: BUG #19737: Empty `JSON_OBJECT` cannot use documented `ON NULL` or unique-key clauses
Date: 2026-11-17 12:03:35
Message-ID: CAH5HC95opj-P2+ju7imj17M+XTx4uAkK7VBHVbMVNMZbap3yUA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Narayanan,

I looked into v3. A couple of points points :

1. Like the commit message, I think we should also update the doc to
say that this behaviour is an extension beyond the SQL standard.
2. It might be worth adding one empty form to the existing "Test
JSON_ARRAY deparsing" section in sqljson.sql, since an empty
JSON_ARRAY with NULL ON NULL now prints a form that wasn't possible
before. For example:

SELECT JSON_ARRAY(NULL ON NULL RETURNING jsonb);
CREATE VIEW json_array_view AS
SELECT JSON_ARRAY(NULL ON NULL RETURNING jsonb);
\sv json_array_view
DROP VIEW json_array_view;

which shows JSON_ARRAY( NULL ON NULL RETURNING jsonb) in the view definition.

Please let me know what you think.

Thanks & Regards,
Nitin Motiani
Google

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2026-11-17 13:18:49 BUG #19911: Window aggregate over ROWS n FOLLOWING: "unexpected end of tuplestore" after spill
Previous Message Jesper St John 2026-11-17 11:35:37 Re: Timing issue in pg_basebackup