pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPython UCS4 error
6+ messages / 3 participants
[nested] [flat]
* Python UCS4 error
@ 2011-07-05 17:21 c k <shreeseva.learning@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: c k @ 2011-07-05 17:21 UTC (permalink / raw)
To: pgsql-admin
Dear All,
I updated my development machine with Fedora 15 and as there is python 2.7.
I have also migrated my few postgresql databases. While creating plpython in
one database, I got the following error undefined symbol
PyUnicodeUCS4_AsEncodedString.
Then I recompiled source code and got a plpython.so compiled for python 2.7
(default python comes with fedora15) and replaced original with this one.
Restarted postgresql and still same error occurs.
When checked for where a python is with ucs4 or ucs2 using following
script, it says it is ucs4.
>>> import sys
>>> print sys.maxunicode
1114111
How to solve this error?
Waiting for your help !
Regards,
C P Kulkarni
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Python UCS4 error
@ 2011-07-05 18:54 Tom Lane <tgl@sss.pgh.pa.us>
parent: c k <shreeseva.learning@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2011-07-05 18:54 UTC (permalink / raw)
To: c k <shreeseva.learning@gmail.com>; +Cc: pgsql-admin
c k <shreeseva.learning@gmail.com> writes:
> I updated my development machine with Fedora 15 and as there is python 2.7.
> I have also migrated my few postgresql databases. While creating plpython in
> one database, I got the following error undefined symbol
> PyUnicodeUCS4_AsEncodedString.
> Then I recompiled source code and got a plpython.so compiled for python 2.7
> (default python comes with fedora15) and replaced original with this one.
> Restarted postgresql and still same error occurs.
plpython seems to work for me on Fedora 15, so you're going to need to
be more specific about how to trigger this error.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Python UCS4 error
@ 2011-07-06 02:34 c k <shreeseva.learning@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 6+ messages in thread
From: c k @ 2011-07-06 02:34 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin; pgsql-general@postgresql.org
I have default python 2.7.1 installed along with fedora15. Then installed
postgresql from binary installers. This creates the plpython.so,
plpython2.so and plpython3.so in lib/postgresql directory under postgresql
installation. When I go for creating a new language plpython, it gives me
some error regarding pythonś version. By default it is compiled with 2.6 and
I have 2.7, so I need to get source code and compile it against python 2.7.
For this I will configure --with-python option and see which python it uses
and where it is located. For me it used python 2.7 and shown the python
default installation. Then I used ´make' and ´make install world´ and copied
plpython.so and plpython2.so to new postgresql installation. Started the
server and try to create new language, then the earlier mentioned error
comes as
undefined symbol: PyUnicodeUCS4_AsEncodedString.
Previously It was working on fedora 14 . It seems that I have to recompile
and install python 2.7 at another location and use it for postgresql make
process. But not sure that it will solve error.
Thanks and regards,
C P Kulkarni
On Wed, Jul 6, 2011 at 12:24 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> c k <shreeseva.learning@gmail.com> writes:
> > I updated my development machine with Fedora 15 and as there is python
> 2.7.
> > I have also migrated my few postgresql databases. While creating plpython
> in
> > one database, I got the following error undefined symbol
> > PyUnicodeUCS4_AsEncodedString.
> > Then I recompiled source code and got a plpython.so compiled for python
> 2.7
> > (default python comes with fedora15) and replaced original with this one.
> > Restarted postgresql and still same error occurs.
>
> plpython seems to work for me on Fedora 15, so you're going to need to
> be more specific about how to trigger this error.
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [ADMIN] Python UCS4 error
@ 2011-07-06 03:06 John R Pierce <pierce@hogranch.com>
parent: c k <shreeseva.learning@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: John R Pierce @ 2011-07-06 03:06 UTC (permalink / raw)
To: pgsql-general@postgresql.org
On 07/05/11 7:34 PM, c k wrote:
> I have default python 2.7.1 installed along with fedora15. Then
> installed postgresql from binary installers. This creates the
> plpython.so, plpython2.so and plpython3.so in lib/postgresql directory
> under postgresql installation. When I go for creating a new language
> plpython, it gives me some error regarding pythonś version. By default
> it is compiled with 2.6 and I have 2.7...
the first statement and last seem in contradiction. when you say
'default python 2.7.1 installed', do you mean the default python thats
shipped with Fedora 15 is 2.7 ?
if Fedora 15 ships with Python 2.7, then it appears the 'postgresql from
binary installers' you installed was not built for Fedora 15. Which
'binary installers' were these? The default postgresql 9.0 that is
bundled with Fedora, or something else?
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [GENERAL] Python UCS4 error
@ 2011-07-06 03:33 c k <shreeseva.learning@gmail.com>
parent: John R Pierce <pierce@hogranch.com>
0 siblings, 1 reply; 6+ messages in thread
From: c k @ 2011-07-06 03:33 UTC (permalink / raw)
To: John R Pierce <pierce@hogranch.com>; +Cc: pgsql-admin; Tom Lane <tgl@sss.pgh.pa.us>
yes, shipped with fedora 15 and binary installers are from EnterpriseDB -
all in one.
CPK
On Wed, Jul 6, 2011 at 8:36 AM, John R Pierce <pierce@hogranch.com> wrote:
> On 07/05/11 7:34 PM, c k wrote:
>
>> I have default python 2.7.1 installed along with fedora15. Then installed
>> postgresql from binary installers. This creates the plpython.so,
>> plpython2.so and plpython3.so in lib/postgresql directory under postgresql
>> installation. When I go for creating a new language plpython, it gives me
>> some error regarding pythonś version. By default it is compiled with 2.6 and
>> I have 2.7...
>>
>
> the first statement and last seem in contradiction. when you say
> 'default python 2.7.1 installed', do you mean the default python thats
> shipped with Fedora 15 is 2.7 ?
>
> if Fedora 15 ships with Python 2.7, then it appears the 'postgresql from
> binary installers' you installed was not built for Fedora 15. Which
> 'binary installers' were these? The default postgresql 9.0 that is bundled
> with Fedora, or something else?
>
>
>
> --
> john r pierce N 37, W 122
> santa cruz ca mid-left coast
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/**mailpref/pgsql-general<http://www.postgresql.org/mailpref/pgsql-gener...;
>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [GENERAL] Python UCS4 error
@ 2011-07-06 06:08 c k <shreeseva.learning@gmail.com>
parent: c k <shreeseva.learning@gmail.com>
0 siblings, 0 replies; 6+ messages in thread
From: c k @ 2011-07-06 06:08 UTC (permalink / raw)
To: John R Pierce <pierce@hogranch.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin; pgsql-general@postgresql.org
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@hogranch.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
>
>
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2011-07-06 06:08 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-07-05 17:21 Python UCS4 error c k <shreeseva.learning@gmail.com>
2011-07-05 18:54 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-07-06 02:34 ` c k <shreeseva.learning@gmail.com>
2011-07-06 03:06 ` John R Pierce <pierce@hogranch.com>
2011-07-06 03:33 ` c k <shreeseva.learning@gmail.com>
2011-07-06 06:08 ` c k <shreeseva.learning@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox