Re: ERROR: record type has not been registered

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ERROR: record type has not been registered
Date: 2010-01-03 22:06:33
Message-ID: 9073.1262556393@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)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 type RECORD. 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2010-01-03 22:43:19 Re: pg_migrator issues
Previous Message Peter Eisentraut 2010-01-03 20:37:10 ERROR: record type has not been registered