Re: Polymorphic functions' weird behavior - Mailing list pgsql-general

From Tom Lane
Subject Re: Polymorphic functions' weird behavior
Date
Msg-id 25480.1185897162@sss.pgh.pa.us
Whole thread Raw
In response to Polymorphic functions' weird behavior  (Viatcheslav Kalinin <vka@ipcb.net>)
List 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 by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: psql 8.2 client vs pg 8.1 server problem
Next
From: Bob Pawley
Date:
Subject: PG Admin