Re: Re: [COMMITTERS] pgsql: Fix mapping of PostgreSQL encodings to Python encodings. - Mailing list pgsql-hackers

From Jan Urbański
Subject Re: Re: [COMMITTERS] pgsql: Fix mapping of PostgreSQL encodings to Python encodings.
Date
Msg-id 4FF754CC.3030401@wulczer.org
Whole thread Raw
In response to Re: Re: [COMMITTERS] pgsql: Fix mapping of PostgreSQL encodings to Python encodings.  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Re: [COMMITTERS] pgsql: Fix mapping of PostgreSQL encodings to Python encodings.  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On 06/07/12 22:47, Peter Eisentraut wrote:
> On fre, 2012-07-06 at 18:53 +0300, Heikki Linnakangas wrote:
>>> What shall we do about those? Ignore them? Document that if you're sing
>>> one of these encodings then PL/Python with Python 2 will be crippled and
>>> with Python 3 just won't work?
>>
>> We could convert to UTF-8, and use the PostgreSQL functions to convert
>> from UTF-8 to the server encoding. Double conversion might be slow, but
>> I think it would be better than failing.
>
> Actually, we already do the other direction that way
> (PLyUnicode_FromStringAndSize) , so maybe it would be more consistent to
> always use this.
>
> I would hesitate to use this as a kind of fallback, because then we
> would sometimes be using PostgreSQL's recoding tables and sometimes
> Python's recoding tables, which could became confusing.

So you're in favour of doing unicode -> bytes by encoding with UTF-8 and 
then using the server's encoding functions?


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: WAL format changes
Next
From: Greg Stark
Date:
Subject: Re: WAL format changes