Re: ERROR: record type has not been registered - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ERROR: record type has not been registered
Date
Msg-id 9073.1262556393@sss.pgh.pa.us
Whole thread Raw
In response to ERROR: record type has not been registered  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> This was a random attempt to figure something out about min/max on row
> types:

> => select min(a) from (values (row(1,2,3)), (row(3,4,5))) as x(a);
> ERROR:  42809: record type has not been registered
> LOCATION:  lookup_rowtype_tupdesc_internal, typcache.c:341

> I don't know whether it's supposed to work, but the error message
> doesn't help much.  Perhaps room for improvement?

Hmm.  It's not going to work because there is no min(record) aggregate.
However, it's failing before it figures that out.  The problem seems
to be in expandRecordVariable:
           /*            * This case should not occur: a column of a table or values list            * shouldn't have
typeRECORD.  Fall through and fail (most            * likely) at the bottom.            */
 

The comment is correct that we don't allow nameless record types as
columns of real tables.  Maybe we need to disallow them as columns of
VALUES, too.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: ERROR: record type has not been registered
Next
From: Bruce Momjian
Date:
Subject: Re: pg_migrator issues