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

From Pedro Gimeno
Subject Re: BUG #13960: plpython fails with certain function names
Date
Msg-id 56C52E2C.3000602@formauri.es
Whole thread Raw
In response to Re: BUG #13960: plpython fails with certain function names  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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.

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #13963: pg_clusterupgrade and materialized view
Next
From: gboscarino@computer.org
Date:
Subject: BUG #13969: PostgreSQL 9.5.0-1 no longer available from apt.postgresql.org