Re: json/jsonb cleanup + FmgrInfo caching

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json/jsonb cleanup + FmgrInfo caching
Date: 2026-10-18 03:33:54
Message-ID: CAGRkXqTgwNKmZVK=3CpYZAdcatHEajOysyb072vwNuYUtX18eA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Jian,

v2 fixes the ROW() cases on 19 and master, and all tests pass.

Named composite types still have the problem. ALTER TYPE can add a
timestamptz after the index is built.

CREATE TYPE c AS (x int);
CREATE TABLE t (v c);
CREATE INDEX ON t ((json_array(v returning jsonb)));
ALTER TYPE c ADD ATTRIBUTE ts timestamptz;
SET TimeZone = 'UTC';
INSERT INTO t VALUES (row(1, '2026-01-01 00:00+00'));
SET TimeZone = 'Asia/Shanghai';
SELECT count(*) FROM t
WHERE json_array(v returning jsonb) =
json_array(row(1, '2026-01-01 00:00+00')::c returning jsonb);

The index scan returns 0 and the seq scan returns 1. 18 rejects the
CREATE INDEX.

Thanks,
Shihao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-10-18 03:47:37 Re: Wrong results from a parameterized Append
Previous Message Manu 2026-10-18 02:54:07 Re: query_int wrongly parses zero-padded input