Re: finish TODOs in to_json_is_immutable, to_jsonb_is_immutable also add tests on it
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: jian he <jian.universality@gmail.com>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2026-03-05T22:09:09Z
Lists: pgsql-hackers
Attachments
- v5-0001-make-to_json-to_jsonb-immutability-test-complete.patch (text/x-patch) patch v5-0001
On 2026-01-08 Th 2:05 AM, jian he wrote:
> hi.
>
> rebase due to conflict in
> https://git.postgresql.org/cgit/postgresql.git/commit/?id=ba75f717526cbaa9000b546aac456e43d03aaf53
>
>
Here's a rework of this patch. It preserves the original signature of
to_json{b}_is_immutable, and fixes some code duplication. It also uses
the typecache to get composite info instead of calling relation_open,
supports MultiRange types, and exits early if we made a recursive call
(no need for json_categorize_type etc. in these cases).
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
Commits
-
make immutability tests in to_json and to_jsonb complete
- ecd9288624a1 19 (unreleased) landed
-
Include error location in errors from ComputeIndexAttrs().
- ba75f717526c 19 (unreleased) cited
-
SQL/JSON: add standard JSON constructor functions
- 7081ac46ace8 16.0 cited