"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Wed, Aug 5, 2015 at 5:57 PM, <maciek@heroku.com> wrote:
>> maciek=# with foo(a) as (select 1) select (select (foo) from foo).* from
>> foo;
>> ERROR: record type has not been registered
> âSuggestions are welcomed though this is an existing limitation of
> PostgreSQL. The planner does not capture enough information to deal with
> constructs of the form (ROW(...)).* â
> regardless of how they were formed. The above is the equivalent to:
> SELECT (foo.foo_val).* FROM ( VALUES (ROW(1)) ) foo (foo_val) which is
> likewise unresolvable.
> âSomething like: "wildcard expansion of uncataloged ârecord type not
> possible" ?
It's a bug IMO. The reason the error message is not very transparent
is that it's not meant to ever be seen by users. Hence, improving the
wording would just be putting lipstick on the wrong end of a pig.
regards, tom lane
(But having said that, I've not looked into how hard it'd be to fix this
particular case...)