Re: [HACKERS] Aggregates and row types - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Aggregates and row types
Date
Msg-id 1968.1490154759@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] Aggregates and row types  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-hackers
Thomas Munro <thomas.munro@enterprisedb.com> 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);count 
-------    1
(1 row)
        regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] [PATCH v1] Add and report the new "in_hot_standby" GUCpseudo-variable.
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Create replication slot in pg_basebackup if requestedand not yet present