Re: BUG #13960: plpython fails with certain function names - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13960: plpython fails with certain function names
Date
Msg-id 4535.1455498553@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #13960: plpython fails with certain function names  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: BUG #13960: plpython fails with certain function names
List pgsql-bugs
Jim Nasby <Jim.Nasby@bluetreble.com> writes:
> On 2/14/16 6:49 PM, Tom Lane wrote:
>> No, because then you would get collisions, ie function names that look
>> different to PG would look the same to python.  Bad news.

> IIRC we append the regproc OID to ensure it's unique.

Ah, okay, problem solved.

>> (Actually, don't we have that issue anyway because of schemas?  I wonder
>> why we are exposing the PG name of the function to python at all.)

> Not sure. Maybe useful in a call stack inside python? I can't really
> think of what else you'd use it for. (I assume you're suggesting just
> call the function names something like plpython_<regproc::oid>.)

Yeah, that's what I was thinking about.  But yes, if we append the OID
anyway then we might as well just strip all non-alphanumeric chars
from the name.  Safe and you still get some debuggability.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Jim Nasby
Date:
Subject: Re: BUG #13960: plpython fails with certain function names
Next
From: Michael Paquier
Date:
Subject: Re: Standbys using commas in application_name cannot become sync nodes