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

Поиск
Список
Период
Сортировка
От Timmy
Тема Re: Re: Can not decompress a compressed string under plpy!
Дата
Msg-id 20090521222622.909FAE07C2@obav06.netvigator.com
обсуждение исходный текст
Ответы Re: Re: Re: [GENERAL] Can not decompress a compressed string under plpy!  (Adrian Klaver <aklaver@comcast.net>)
Список pgsql-general
> > 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
>

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!





В списке pgsql-general по дате отправления:

Предыдущее
От: Chris Browne
Дата:
Сообщение: Re: Postgres, DB design, and object IDs (of any ilk)
Следующее
От: Reid Thompson
Дата:
Сообщение: Re: running postgresql on a private machine accessing it from public web pages