From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | khuddleston(at)pivotal(dot)io, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org> |
Subject: | Re: BUG #14706: Dependencies not recorded properly for base types |
Date: | 2017-06-15 04:52:01 |
Message-ID: | CAB7nPqTyfyxiG2if30eMPRTx9=dTtBPKrLh2g6tNpa1B4=9LPA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Thu, Jun 15, 2017 at 9:42 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> khuddleston(at)pivotal(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2017-06-15 04:53:54 | Re: BUG #14706: Dependencies not recorded properly for base types |
Previous Message | Tom Lane | 2017-06-15 01:02:28 | Re: BUG #14706: Dependencies not recorded properly for base types |