Re: [GENERAL] Python UCS4 error

From: c k <shreeseva(dot)learning(at)gmail(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Python UCS4 error
Date: 2011-07-06 06:08:13
Message-ID: CAN2Y=uNueP8+_fLDT3P0SgNvXViWeScPa36zRtFZHMQUExdXQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Solved.
Here is the procedure to get working with plpython ucs2 or ucs4 error. By
default python uses ucs2 and we have to change it to ucs4.
compile python2.7 or 3 with options as below.
./configure --enable-unicode=ucs4
then use
make and make altinstall
then use the python path for postgresql source configuration within
postgresql source directory
./configure --with-python PYTHON=/usr/local/bin/python2.7 (replace with your
python installation path)
then use
make and make install-world
Copy the plpython.so, plpython2.so or plpython3.so from local postgresql
install directory (normally /usr/local/pgsql/lib) to the required
installtion lib directory.
make proper local links to files if required.
start the postgresql
with a database create a new language as plpythonu, plpython2u or plpython3u
as required.
create a simple function as below to test plpython working
CREATE or replace FUNCTION pyver() RETURNS text
LANGUAGE plpythonu
AS $$
import sys
#return sys.version
return sys.path
$$;

if it shown the version then check it with your newly installed alternative
python version. Also check path from function and from python. If both
matches then you can use plpython properly.

Regards,
C P Kulkarni
On Wed, Jul 6, 2011 at 9:25 AM, John R Pierce <pierce(at)hogranch(dot)com> wrote:

> On 07/05/11 8:33 PM, c k wrote:
>
>> yes, shipped with fedora 15 and binary installers are from EnterpriseDB -
>> all in one.
>>
>>
> any reason you didn't use the Fedora 15 native version of Postgres 9.0.x ?
> should be as simple as
>
> $ sudo yum install postgresql-server
>
>
>
>
>
>
> --
> john r pierce N 37, W 122
> santa cruz ca mid-left coast
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message francescoboccacci@libero.it 2011-07-06 08:19:35 adminpack installation problem
Previous Message c k 2011-07-06 03:33:58 Re: [GENERAL] Python UCS4 error

Browse pgsql-general by date

  From Date Subject
Next Message Durumdara 2011-07-06 08:42:52 Re: When the Session ends in PGSQL?
Previous Message c k 2011-07-06 03:33:58 Re: [GENERAL] Python UCS4 error