JSON array is not updated if updating with empty array

From: Radics Geza <radicsge(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: JSON array is not updated if updating with empty array
Date: 2020-03-06 18:52:43
Message-ID: CAJFbfO84H34Fqyxgk2S8erN+FarooDeKS+vMM1dvvs9gPkq5oA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Json column is not updated if the update is an empty array '[]'.

UPDATE table SET "jsonbcol" = '[{"a":1}]';
UPDATE table SET "jsonbcol = '[]' RETURNING "jsonbcol";

jsonbcol
------------
[{"a": 1}]
(1 row)

It worked in postgres 9.6, but not in 11.7 / 12.2

thanks!

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Janes 2020-03-06 19:09:13 Re: BUG #16287: 'Server doesn't listen' after setting 'timezone' to "America/Detroit US/Michigan"
Previous Message PG Bug reporting form 2020-03-06 18:31:04 BUG #16287: 'Server doesn't listen' after setting 'timezone' to "America/Detroit US/Michigan"