By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
CREATE TYPE myrowtype AS (xx1 int, xx2 text, xx3 numeric);
SELECT t AS t1, row_to_json(t) AS j1
, ROW(1, 'x', NUMERIC '42.1') AS r2, row_to_json(ROW(1, 'x', NUMERIC '42.1')) AS j2
, (1, 'x', NUMERIC '42.1') AS r3, row_to_json( (1, 'x', NUMERIC '42.1')) AS j3
, (1, 'x', '42.1')::myrowtype AS r4, row_to_json((1, 'x', '42.1')::myrowtype) AS j4
FROM (SELECT 1, 'x', NUMERIC '42.1') t;
t1 | j1 | r2 | j2 | r3 | j3 | r4 | j4 |
---|---|---|---|---|---|---|---|
(1,x,42.1) | {"?column?":1,"?column?":"x","numeric":42.1} | (1,x,42.1) | {"f1":1,"f2":"x","f3":42.1} | (1,x,42.1) | {"f1":1,"f2":"x","f3":42.1} | (1,x,42.1) | {"xx1":1,"xx2":"x","xx3":42.1} |