Обсуждение: Question on "record type has not been registered"

Поиск
Список
Период
Сортировка

Question on "record type has not been registered"

От
Jim Nasby
Дата:
I'm working on a function(attached) that returns a bitmask of NULL
fields in a record. It works fine if I feed it a row directly, but fails
in this case:

select record_nulls(r), expected, CASE WHEN record_nulls(r) <> expected
THEN 'BAD' END AS bad, r
from (values(row(NULL,NULL,NULL,2,2,NULL,2,2), '11100100'::varbit),
(row(2),'0')
) v(r,expected)
;
ERROR:  record type has not been registered

I'm not sure why this is failing; a simple SELECT * from that FROM
clause works fine. I also tried removing the second row in case the
mismatch of record types was the issue; that didn't help either.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)   mobile: 512-569-9461

Вложения