Can not decompress a compressed string under plpy!

Поиск
Список
Период
Сортировка
Искать

Can not decompress a compressed string under plpy!

От:
Timmy <timheit@netvigator.com>
Дата:
Hi,
   I have stored a compressed string in a table field.
The compressed string is created by zlib using python.
I want to decompress this string by zlib under plpy but plpy fails to do so. 
Is plpy not support decompression? Why?

Thanks!


Re: Can not decompress a compressed string under plpy!

От:
Adrian Klaver <aklaver@comcast.net>
Дата:
On Wednesday 20 May 2009 6:06:17 am Timmy wrote:
> Hi,
>    I have stored a compressed string in a table field.
> The compressed string is created by zlib using python.
> I want to decompress this string by zlib under plpy but plpy fails to do
> so. Is plpy not support decompression? Why?
>
> Thanks!

A bit more information is required. What version of Postgres are you using, what 
OS?  I am guessing that the compressed string is being created by a Python 
program external to the database and then inserted into a field, is this 
correct? You are then trying to decompress the string via a plpythonu function 
within the database,correct? Did you import the zlib module into the plpythonu 
function?

-- 
Adrian Klaver
aklaver@comcast.net

Re: Can not decompress a compressed string under plpy!

От:
Jasen Betts <jasen@xnet.co.nz>
Дата:
On 2009-05-20, Timmy  wrote:
> Hi,
>    I have stored a compressed string in a table field.
> The compressed string is created by zlib using python.
> I want to decompress this string by zlib under plpy but plpy fails to do so. 
> Is plpy not support decompression? Why?

are you storing it in a bytea column?
is the string correctly unescaped before you attempt decompressing it?
are you able to extract and decompress the string by other means (as
proof that it has been stored correctly)

FAQ