Re: BUG #17066: Cache lookup failed when null (iso-8859-1) is passed as anycompatiblemultirange

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: BUG #17066: Cache lookup failed when null (iso-8859-1) is passed as anycompatiblemultirange
Дата
Msg-id CAPpHfdu4MhM_rrdGf6uZN9uh2=9ay-a2s=bpVzG_BoTSD4RU_w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17066: Cache lookup failed when null (iso-8859-1) is passed as anycompatiblemultirange  (Alexander Korotkov <aekorotkov@gmail.com>)
Ответы Re: BUG #17066: Cache lookup failed when null (iso-8859-1) is passed as anycompatiblemultirange
Список pgsql-bugs
On Thu, Jun 24, 2021 at 1:41 AM Alexander Korotkov <aekorotkov@gmail.com> wrote:
> On Wed, Jun 23, 2021 at 6:31 PM Alexander Korotkov <aekorotkov@gmail.com> wrote:
> > On Tue, Jun 22, 2021 at 7:01 PM Alexander Korotkov <aekorotkov@gmail.com> wrote:
> > > On Tue, Jun 22, 2021 at 4:42 PM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> > > > On 2021-Jun-22, Neil Chen wrote:
> > > >
> > > > > Greetings,
> > > > >
> > > > > I tried to investigate the bug, but the complicated logic here completely
> > > > > messed up my mind...
> > > > >
> > > > > Anyway, this patch can fix it and make the regress test happy. But I think
> > > > > it's better to get the author's advice - I copied this email to Alvaro,
> > > > > hope it doesn't offend him...
> > > >
> > > > Without looking too deeply, the patch seems sensible to me.  However,
> > > > I'm CC'ing Alexander and Paul :-)
> > >
> > > Thank you for pointing this out.  And thanks to Neil for the fix.
> > >
> > > Looks good at the first glance.  I'm going to review this in the next
> > > couple of days.
> >
> > I've reviewed enforce_generic_type_consistency() more carefully.  It
> > looks for me that this function requires more significant rework.  For
> > instance, these two functions throw errors, but it seems that both of
> > them should work.
> >
> > create function multirange_func(r anycompatiblerange)
> >   returns anycompatiblemultirange as 'select multirange($1);' language sql;
> > create function range_func(r anycompatiblemultirange)
> >   returns anycompatiblerange as 'select multirange($1);' language sql;
> >
> > # select multirange_func(int4range(1,10));
> > ERROR:  could not identify anycompatiblemultirange type
> >
> > # select range_func(int4multirange(int4range(1,10)));
> > ERROR:  could not determine polymorphic type anycompatiblerange
> > because input has type unknown
> >
> > So, I'm still investigating this.
>
> The second function was intended to be this to be a meaningful
> example.  But anyway it fails with the same error.
>
> create function range_func(r anycompatiblemultirange)
>   returns anycompatiblerange as 'select range_merge($1);' language sql;

I've a bit stuck in understanding of
enforce_generic_type_consistency().  There is a set of "argument
declared..." errors.  But they aren't present in regression tests.
And I didn't manage to reproduce them, because a function is filtered
out before entering enforce_generic_type_consistency() and I get just
"No function matches ..." error.

Are "argument declared..." errors just internal, which users shouldn't
normally see.  Or do they happen in some circumstances?  If latter,
then I think it should be added to the regression tests.

I really appreciate a hint here.

------
Regards,
Alexander Korotkov



В списке pgsql-bugs по дате отправления:

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: BUG #17066: Cache lookup failed when null (iso-8859-1) is passed as anycompatiblemultirange
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17066: Cache lookup failed when null (iso-8859-1) is passed as anycompatiblemultirange