Re: Polymorphic functions' weird behavior

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Polymorphic functions' weird behavior
Дата
Msg-id 25480.1185897162@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Polymorphic functions' weird behavior  (Viatcheslav Kalinin <vka@ipcb.net>)
Список pgsql-general
Viatcheslav Kalinin <vka@ipcb.net> writes:
> Now we change SECURITY INVOKER clause to SECURITY DEFINER and voila:

>>> select * from array_to_set(array[1,2,3]);
> ERROR:  could not determine actual argument type for polymorphic
> function "array_to_set"

Wow, apparently you're the first person ever to try that, because it's
never worked in any release since polymorphism was introduced :-(.
Thanks for the report!

The fix is pretty easy if you need it now:

Index: fmgr.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v
retrieving revision 1.102
diff -c -r1.102 fmgr.c
*** fmgr.c    4 Oct 2006 00:30:01 -0000    1.102
--- fmgr.c    31 Jul 2007 15:39:29 -0000
***************
*** 793,798 ****
--- 793,799 ----

          fmgr_info_cxt_security(fcinfo->flinfo->fn_oid, &fcache->flinfo,
                                 fcinfo->flinfo->fn_mcxt, true);
+         fcache->flinfo.fn_expr = fcinfo->flinfo->fn_expr;

          tuple = SearchSysCache(PROCOID,
                                 ObjectIdGetDatum(fcinfo->flinfo->fn_oid),


            regards, tom lane

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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: psql 8.2 client vs pg 8.1 server problem
Следующее
От: Bob Pawley
Дата:
Сообщение: PG Admin