python - be: Implement encoding "choregraphy". - Mailing list pgsql-committers

From jwp@pgfoundry.org (James William Pye)
Subject python - be: Implement encoding "choregraphy".
Date
Msg-id 20050629234013.5B6E411260AA@pgfoundry.org
Whole thread Raw
List 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)

pgsql-committers by date:

Previous
From: builder@pgfoundry.org (User Builder)
Date:
Subject: bizgres - bizgres: Introduce release Release-0_6_1
Next
From: tgl@svr1.postgresql.org (Tom Lane)
Date:
Subject: pgsql: Improve the checkpoint signaling mechanism so that the bgwriter