Re: Problems with pgcrypto and special characters

Поиск
Список
Период
Сортировка
От Markus Wollny
Тема Re: Problems with pgcrypto and special characters
Дата
Msg-id 2266D0630E43BB4290742247C891057502B9D6E3@dozer.computec.de
обсуждение исходный текст
Ответ на Problems with pgcrypto and special characters  ("Markus Wollny" <Markus.Wollny@computec.de>)
Список pgsql-general
Hi!

-----Original Message-----
From:    Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Possibly a binary cast (WITHOUT FUNCTION) would solve your problem,
> though I doubt it will work well on bytea values containing \0.

Thanks, I've been a bit thick here, but I just found the solution to my problem - and that doesn't need this awkward
functionnor any type of extra WITHOUT FUNCTION casts - just decode and encode, alas in exactly the opposite order than
Ioriginally expected. 

mypgdb=# select decode('Tübingen'::text,'escape');
     decode
-----------------
 T\303\274bingen
(1 row)

mypgdbe=# select encode('T\303\274bingen','escape');
  encode
----------
 Tübingen
(1 row)

I think this should be safe for any kind of bytea value.

Kind regards

   Markus


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

Предыдущее
От: "Markus Wollny"
Дата:
Сообщение: Re: Problems with pgcrypto and special characters
Следующее
От: Tom Lane
Дата:
Сообщение: Re: indexing date_part