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

From: Pedro Gimeno <parigalo(at)formauri(dot)es>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-18 02:36:28
Message-ID: 56C52E2C.3000602@formauri.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message gboscarino 2016-02-18 02:44:44 BUG #13969: PostgreSQL 9.5.0-1 no longer available from apt.postgresql.org
Previous Message Venkata Balaji N 2016-02-18 01:00:25 Re: BUG #13962: transaction logs growing on standby