Re: [GENERAL] Python UCS4 error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx> 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



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux