Michael Paquier wrote:
> Hi all,
>
> I just bumped into the following problem in HEAD (1c41e2a):
> =# create type my_array_float (INPUT = array_in, OUTPUT = array_out,
> ELEMENT = float4, INTERNALLENGTH = 32);
> ERROR: XX000: cache lookup failed for type 0
> LOCATION: format_type_internal, format_type.c:135
Argh.
> The fix consists in being sure that typoid uses the OID of the type
> shell created, aka the OID stored in adress.ObjectID. Attached is a
> patch with a regression test checking for shell creation with
> incompatible input/output functions (failure caused by output function
> here though) able to check this code path.
Thanks, pushed. I changed the line to be just below TypeShellMake,
which seems slightly better aligned to the comment just below, and in
fact it matches what DefineRange already uses. I also modified a couple
of other places involving TypeCreate: one did not have the "typoid =
addr.objectId" assignment at all; while the other did, it actually seems
misplaced because at that spot we expect that typoid is already correct.
So I added an assert to the other place and changed that assignment to
an assert, too.
I scanned the rest of the bogus commit and couldn't find any other place
on which I made the same mistake.
Thanks for reporting,
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services