pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list
3+ messages / 3 participants
[nested] [flat]

* BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list
@ 2015-08-06 00:57 maciek@heroku.com
  2015-08-06 03:21 ` 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>
  0 siblings, 1 reply; 3+ messages in thread

From: maciek@heroku.com @ 2015-08-06 00:57 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      13539
Logged by:          Maciek Sakrejda
Email address:      maciek@heroku.com
PostgreSQL version: 9.4.4
Operating system:   Ubuntu 15.04
Description:        

I'm not sure if this is a legitimate bug, but the error message is unclear.
I've searched for this message and have seen reports of similar errors, but
the SQL is somewhat different, so I thought I'd report it:

maciek=# with foo(a) as (select 1) select (select (foo) from foo).* from
foo;
ERROR:  record type has not been registered

I know how to work around it; just reporting it in the hope of maybe getting
a clearer error.

Thanks!


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list
  2015-08-06 00:57 BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list maciek@heroku.com
@ 2015-08-06 03:21 ` David G. Johnston <david.g.johnston@gmail.com>
  2015-08-06 03:33   ` Re: BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: David G. Johnston @ 2015-08-06 03:21 UTC (permalink / raw)
  To: Maciek Sakrejda <maciek@heroku.com>; +Cc: pgsql-bugs

On Wed, Aug 5, 2015 at 5:57 PM, <maciek@heroku.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      13539
> Logged by:          Maciek Sakrejda
> Email address:      maciek@heroku.com
> PostgreSQL version: 9.4.4
> Operating system:   Ubuntu 15.04
> Description:
>
> I'm not sure if this is a legitimate bug, but the error message is unclear.
> I've searched for this message and have seen reports of similar errors, but
> the SQL is somewhat different, so I thought I'd report it:
>
> maciek=# with foo(a) as (select 1) select (select (foo) from foo).* from
> foo;
> ERROR:  record type has not been registered
>
> I know how to work around it; just reporting it in the hope of maybe
> getting
> a clearer error.
>

​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" ?

To my recollection the concept of "type registration" is not used in the
user documentation.  Uncataloged at least implies that using CREATE TYPE
(or table/view implicitly) to add a named type to the system type catalog
would resolve the problem.  Though an implied "create function returns
table" type does get "registered" in the planner so maybe that is too
specific...

David J.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list
  2015-08-06 00:57 BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list maciek@heroku.com
  2015-08-06 03:21 ` 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>
@ 2015-08-06 03:33   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2015-08-06 03:33 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Maciek Sakrejda <maciek@heroku.com>; 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...)


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2015-08-06 03:33 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-08-06 00:57 BUG #13539: ERROR: record type has not been registered with CTE and subselect in target list maciek@heroku.com
2015-08-06 03:21 ` David G. Johnston <david.g.johnston@gmail.com>
2015-08-06 03:33   ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox