Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types
Date
Msg-id CAB7nPqTyfyxiG2if30eMPRTx9=dTtBPKrLh2g6tNpa1B4=9LPA@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Thu, Jun 15, 2017 at 9:42 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> khuddleston@pivotal.io writes:
>> CREATE FUNCTION base_fn_in(cstring) returns opaque as 'boolin' language
>> internal;
>> CREATE FUNCTION base_fn_out(opaque) returns opaque as 'boolout' language
>> internal;
>> CREATE TYPE base_type(input=base_fn_in, output=base_fn_out);
>
> You realize of course that this is long-deprecated style.
>
>> DROP TYPE base_type;
>> \df
>> ERROR:  cache lookup failed for type 22241 (format_type.c:137)
>
> ... but yeah, as long as we're supporting it at all, that shouldn't
> happen.  Thanks for the report!

The return type of the input function and argument type of the output
function get updated when the type is created via
SetFunctionReturnType(). This code is actually missing the fact that
at the same time to add dependencies in pg_depend which should add a
link between the function as objid to the type as refobjid. The
reversed dependency is tracked though. Tom, are you working on a
patch? At quick glance, this is just missing a call to
recordDependencyOn() in SetFunctionReturnType().
-- 
Michael


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types