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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Maciek Sakrejda <maciek(at)heroku(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list
Date: 2015-08-06 03:33:01
Message-ID: 31181.1438831981@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Wed, Aug 5, 2015 at 5:57 PM, <maciek(at)heroku(dot)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...)

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message sathish kumar 2015-08-06 11:13:50 Re: BUG #13525: Database crashed with several error messages "Could not open file "pg_multixact/members/"
Previous Message David G. Johnston 2015-08-06 03:21:31 Re: BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list