Thomas Munro <> writes:
> Is is expected that the first query below can be analysed and planned,
> but the second can't?

> explain select x from (select row(42)) s(x);

> explain select count(x) from (select row(42)) s(x);
> ERROR:  record type has not been registered

Well, ideally that wouldn't happen, but making it go away isn't
all that trivial.  Try coercing the ROW() expression to some named
composite type.  For example, in the regression database this works:

regression=# select count(x) from (select row(42)::int4_tbl) s(x);
(1 row)

                        regards, tom lane

Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to