Re: BUG #8385: greek symbols as function name

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>, "kolmyk(at)hotmail(dot)com" <kolmyk(at)hotmail(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #8385: greek symbols as function name
Date: 2013-08-18 18:19:24
Message-ID: 1376849964.19363.YahooMailNeo@web162904.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Kevin Grittner <kgrittn(at)ymail(dot)com> wrote:

> Whether it is a bug in Windows or in PostgreSQL character-
> handling under Windows I can say myself, since I haven't
> had any reason to use Windows for years.

Er, that should have been I *can't* say.

>> create or replace function α(β int, ξ int, μ float) returns
float as $$
>> select (β + ξ) * μ $$ language sql;
>> select α(1, 2, 0.1);
>> -- it works
>> select ascii(proname), * from pg_proc where length(proname) = 1;
>> -- return code 60536 although select ascii('α') retruns 945
>> select * from pg_proc where proname = 'α';
>> -- returns nothing

It occurs to me that the behavior you are seeing would be
consistent with 945 being considered an uppercase letter, with
60536 being considered its lowercase form.  Normal PostgreSQL
case-folding of identifiers would then cause exactly the symptoms
you are seeing.  You could test this theory by quoting its use as
an identifier:

create or replace function "α"(β int, ξ int, μ float) returns float
as $$
  select (β + ξ) * μ $$ language sql;
select "α"(1, 2, 0.1);
select ascii(proname), * from pg_proc where length(proname) = 1;
select * from pg_proc where proname = 'α';

If that behaves correctly, you need to sort out what about your
environment is causing the odd case-folding.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2013-08-18 18:40:35 Re: BUG #8385: greek symbols as function name
Previous Message Kevin Grittner 2013-08-18 14:51:46 Re: BUG #8385: greek symbols as function name