Re: plpython issue with Win64 (PG 9.2)

From: Jan Urbański <wulczer(at)wulczer(dot)org>
To: Asif Naeem <asif(dot)naeem(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: plpython issue with Win64 (PG 9.2)
Date: 2012-07-03 22:43:14
Message-ID: 4FF37582.8050201@wulczer.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/07/12 17:45, Jan Urbański wrote:
> On 29/06/12 00:36, Jan Urbański wrote:
>> On 27/06/12 13:57, Jan Urbański wrote:
>>> On 27/06/12 11:51, Asif Naeem wrote:
>>>> Hi,
>>>>
>>>> On Windows 7 64bit, plpython is causing server crash with the following
>>>> test case i.e.
>
>> So: I'd add code to translate WINxxx into CPxxx when choosing the Python
>> to use, change PLy_elog to elog in PLyUnicode_Bytes and leave the
>> SQL_ASCII case alone, as there were no complaints and people using
>> SQL_ASCII are asking for it anyway.
>
> Since no one commented, I'll produce a patch to that effect. I believe
> this should go into 9.2 given that otherwise PL/Python will basically
> crash any database using the CP12xx encoding.

Patch attached. Asif, could you try a few things on a CP1252 database?

First verify if your original test case now works and then try this:

create function enctest() returns text as $$
return b'tr\xc3\xb3spido'.decode('utf-8')
$$ language plpython3u;

select enctest(), encode(convert_to(enctest(), 'utf-8'), 'hex');

Thanks,
Jan

Attachment Content-Type Size
plpython-windows-encodings.patch text/x-diff 2.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-07-03 23:44:50 Re: Event Triggers reduced, v1
Previous Message Tom Lane 2012-07-03 22:37:03 Re: Patch: add conversion from pg_wchar to multibyte