Re: BUG #13960: plpython fails with certain function names

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13960: plpython fails with certain function names
Date: 2016-02-15 01:09:13
Message-ID: 4535.1455498553@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2016-02-15 05:56:45 Re: Standbys using commas in application_name cannot become sync nodes
Previous Message Jim Nasby 2016-02-15 00:56:33 Re: BUG #13960: plpython fails with certain function names