Question on "record type has not been registered"

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Question on "record type has not been registered"
Date: 2016-10-16 19:03:21
Message-ID: 9f1db94a-fa18-5975-3a6c-6850fabb3865@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
record_nulls.diff text/plain 4.5 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2016-10-16 19:25:24 bit|varbit #, xor operator
Previous Message Jeff Janes 2016-10-16 18:33:26 postgres_fdw super user checks