Re: Re: Re: Can not decompress a compressed string under plpy!

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Re: Re: Can not decompress a compressed string under plpy!
Date: 2009-05-26 13:09:57
Message-ID: gvgpn5$ass$2@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2009-05-21, Timmy <timheit(at)netvigator(dot)com> 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.

try running stripslashes on the returned value.
bytea values are returned double-slashed.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brandon Metcalf 2009-05-26 16:37:07 Re: quoting values magic
Previous Message Jasen Betts 2009-05-26 13:00:33 Re: quoting values magic