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

From Jim Nasby
Subject Re: BUG #13960: plpython fails with certain function names
Date
Msg-id 56C53CB1.7070802@BlueTreble.com
Whole thread Raw
In response to BUG #13960: plpython fails with certain function names  (Jim.Nasby@BlueTreble.com)
List pgsql-bugs
On 2/17/16 8:36 PM, Pedro Gimeno wrote:
> Tom Lane wrote, On 2016-02-17 02:49:
>
>> +     /* Replace any not-legal-in-Python-names characters with '_' */
>> +     for (ptr = procName; *ptr; ptr++)
>> +     {
>> +         if (!((*ptr >= 'A' && *ptr <= 'Z') ||
>> +               (*ptr >= 'a' && *ptr <= 'z') ||
>> +               (*ptr >= '0' && *ptr <= '9')))
>> +             *ptr = '_';
>> +     }
>> +
>
> That may blow on names that start with a digit. Maybe
>
> +               (*ptr >= '0' && *ptr <= '9' && ptr != procName)))
>
> Making the testcase start with a digit sounds like a good idea.

Postgres prefaces the name of the python function with a fixed string,
so it will never start with a digit.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: aparent bug with pgAdmin version 1.22.1 connected to pg 9.5: SQL Pane view of SEQUENCE object
Next
From: Artur Zakirov
Date:
Subject: Re: BUG #13964: unexpected result from to_tsvector