Re: Problems with pgcrypto and special characters

Поиск
Список
Период
Сортировка
От Ragnar Hafstað
Тема Re: Problems with pgcrypto and special characters
Дата
Msg-id 1109619413.16688.65.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Problems with pgcrypto and special characters  ("Markus Wollny" <Markus.Wollny@computec.de>)
Список pgsql-general
On Mon, 2005-02-28 at 18:32 +0100, Markus Wollny wrote:
> To get straight to the point, here's my problem:
>
> mypgdb=# select bytea2text(decrypt(encrypt('Tübingen'::bytea,
'mypassphrase'::bytea,'bf'::text),'mypassphrase'::bytea,'bf'::text))as foo; 
>        foo
> -----------------
>  T\303\274bingen
> (1 row)
>
> I have compiled and installed pg_crypto and I'am using the following function as workaround for a bytea-to-text-cast:

are you sure your problem is with pg_crypto ?
what does this produce:
  select bytea2text('Tübingen'::bytea) as foo;
?

have you tried to use encode()/decode() instead ?
untested:
  select
      decode(
          decrypt(
              encrypt(
                  encode('Tübingen','escape') ,
                  'mypassphrase'::bytea,
                  'bf'::text
              ),
              'mypassphrase'::bytea,
              'bf'::text
          )
      ) as foo;

(sorry for the obsessive indentation)

gnari




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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Unicode support on Win32
Следующее
От: "DEV"
Дата:
Сообщение: indexing date_part