Re: BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list
Date
Msg-id 31181.1438831981@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
"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...)

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list
Next
From: sathish kumar
Date:
Subject: Re: BUG #13525: Database crashed with several error messages "Could not open file "pg_multixact/members/"