Problems with pgcrypto and special characters

Поиск
Список
Период
Сортировка
От Markus Wollny
Тема Problems with pgcrypto and special characters
Дата
Msg-id 2266D0630E43BB4290742247C89105750716F8E4@dozer.computec.de
обсуждение исходный текст
Ответы Re: Problems with pgcrypto and special characters  (Ragnar Hafstað <gnari@simnet.is>)
Re: Problems with pgcrypto and special characters  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello!

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:

create or replace function bytea2text(bytea) returns text as '
 begin
   return $1;
 end;
 ' language plpgsql;

The cluster was initialized with locale de_DE.UTF-8, pg_controldata confirms:
LC_COLLATE:                           de_DE.UTF-8
LC_CTYPE:                             de_DE.UTF-8

Database version is PostgreSQL 8.0.1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2

I think I'm missing something very obvious here, so please give me a hint: How can I use pgcrypto to encrypt and
decrypttext which contains UTF-8 special characters like german umlauts? I think that this simple bytea2text-function
probablyneeds a replacement, but I haven't got the faintest clue about how to actually retrieve the original input
afterencryption. Any help would be tremendously appreciated :) 

Thanks in advance!

Kind regards

   Markus

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: row numbering
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Possible to run the server with ANSI/ISO string escapeing