Thread: pgsql: Fix JSON_OBJECTAGG uniquefying bug

pgsql: Fix JSON_OBJECTAGG uniquefying bug

From
Andrew Dunstan
Date:
Fix JSON_OBJECTAGG uniquefying bug

Commit f4fb45d15c contained a bug in removing items with null values when
unique keys are required, where the leading items that are sorted
contained such values. Fix that and add a test for it.

Discussion: https://postgr.es/m/CAJA4AWQ_XbSmsNbW226UqNyRLJ+wb=iQkQMj77cQyoNkqtf=2Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9c3d25e17894f35045a2d57dfb834e25c9dc4c21

Modified Files
--------------
src/backend/utils/adt/jsonb_util.c    | 14 ++++++++++++--
src/test/regress/expected/sqljson.out |  7 +++++++
src/test/regress/sql/sqljson.sql      |  3 +++
3 files changed, 22 insertions(+), 2 deletions(-)