Re: Re: Re: [GENERAL] Can not decompress a compressed string under plpy!

From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Timmy <timheit(at)netvigator(dot)com>
Subject: Re: Re: Re: [GENERAL] Can not decompress a compressed string under plpy!
Date: 2009-05-22 01:36:24
Message-ID: 200905211836.24630.aklaver@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 21 May 2009 3:26:22 pm Timmy wrote:

>
> Yes, most of your guess is correct.
> I'm using postgresql 8.3.x and ms windows 2000.
> The compressed string is saved to the table in binary
> format using the psycopg. I had set the table field to bytea data type.
> I want to use the plpythonu to decompress the stored
> string.
> Althout I imported the zlib module, it still failed.
> I can successfully get back the decompressed string if
> I use the psycopg either inside or outside the plpythonu.
> But if without psycopg, plpythonu itself can not decompress the string.
> I can use the psycopg inside the plpythonu but I must need to write
> security information (including user name,password,server ip,port
> number,...) to the connection string inside plpythonu too. This is a
> problem.
>
> Thanks!

Now you are getting outside my experience level. As a guess though I would say
that psycopg is taking care of escaping the data on the way out, whereas your
plpythonu function is not.
See www.postgresql.org/docs/8.3/interactive/datatype-binary.html for more
information.

--
Adrian Klaver
aklaver(at)comcast(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Duan Ligong 2009-05-22 01:48:19 cascade deleting
Previous Message Timmy 2009-05-21 22:26:22 Re: Re: Can not decompress a compressed string under plpy!