From: | Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Fix mapping of PostgreSQL encodings to Python encodings. |
Date: | 2012-07-05 19:33:38 |
Message-ID: | E1Smro2-0006gU-Ld@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix mapping of PostgreSQL encodings to Python encodings.
Windows encodings, "win1252" and so forth, are named differently in Python,
like "cp1252". Also, if the PyUnicode_AsEncodedString() function call fails
for some reason, use a plain ereport(), not a PLy_elog(), to report that
error. That avoids recursion and crash, if PLy_elog() tries to call
PLyUnicode_Bytes() again.
This fixes bug reported by Asif Naeem. Backpatch down to 9.0, before that
plpython didn't even try these conversions.
Jan Urbański, with minor comment improvements by me.
Branch
------
REL9_2_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/773288016d00bd72e8e2bcb5b1eec67abb2d9e00
Modified Files
--------------
src/pl/plpython/plpy_util.c | 69 ++++++++++++++++++++++++++++++++++++++----
1 files changed, 62 insertions(+), 7 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2012-07-05 20:31:19 | Re: pgsql: Fix mapping of PostgreSQL encodings to Python encodings. |
Previous Message | Tom Lane | 2012-07-05 18:00:56 | pgsql: Remove support for using wait3() in place of waitpid(). |