python - be: Implement encoding "choregraphy".

From: jwp(at)pgfoundry(dot)org (James William Pye)
To: pgsql-committers(at)postgresql(dot)org
Subject: python - be: Implement encoding "choregraphy".
Date: 2005-06-29 23:40:13
Message-ID: 20050629234013.5B6E411260AA@pgfoundry.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Implement encoding "choregraphy".

This fixes issues with reading unicode strings in procedures by specifying the
encoding using the magic comment # -*- encoding: utf-8 -*-. In addition, set the
default unicode encoding after initializing the Postgres interface module.

The interface module now includes an encoding portion that adds PostgreSQL
aliases. This makes using PostgreSQL encoding names with Python seamless.

Add Encoding and EncodingCode to the Postgres module. These functions get the
database's encoding. EncodingCode returns the database's pg_enc, and Encoding
returns the database's encoding as a string(note, translated to the Python
encoding name). (Perhaps an EncodingCodeName should be added as well to get
the database's encoding as a PostgreSQL encoding name).

To do next: translate the procedure source to utf-8 before compilation. After
this, plpy should fully support/recognize the database's encoding.

Modified Files:
--------------
be/include/pypg:
ci.h (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/ci.h.diff?r1=1.2&r2=1.3)
cis.h (r1.3 -> r1.4)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/cis.h.diff?r1=1.3&r2=1.4)
be/test/expected/80:
fund (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/test/expected/80/fund.diff?r1=1.2&r2=1.3)
be/src:
pl.c (r1.19 -> r1.20)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/pl.c.diff?r1=1.19&r2=1.20)
function.c (r1.6 -> r1.7)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/function.c.diff?r1=1.6&r2=1.7)
module.c (r1.16 -> r1.17)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/module.c.diff?r1=1.16&r2=1.17)

Added Files:
-----------
be/include/pypg:
encoding.h (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/encoding.h?rev=1.1&content-type=text/x-cvsweb-markup)
be/src:
encoding.c (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/encoding.c?rev=1.1&content-type=text/x-cvsweb-markup)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2005-06-30 00:00:52 pgsql: Improve the checkpoint signaling mechanism so that the bgwriter
Previous Message User Builder 2005-06-29 23:11:29 bizgres - bizgres: Introduce release Release-0_6_1