Re: How to convert BYTEA (from decrypt) to TEXT?

From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to convert BYTEA (from decrypt) to TEXT?
Date: 2012-04-23 12:50:06
Message-ID: CAHjZ2x4f1h5yBv66UzanP6Kp7SJXBd+wyqDveBQj2na5s8qbhg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2012/4/23 Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>:
> Hi all.
> I know that the output of a decrypt() call (from pgcrypto module) can
> be safely converted to TEXT.
> CAST( decrypt( data,key,'bf' ) as TEXT ) (and other variants) just doesn't work.
> How can I (possibly easily) do it?
> Thanks.

Found!
It is on chapter 9.4

select
*
from convert_from( decrypt(
'\x864b9b7e89f7beda7030b3918811299f3489315f7818f594a16fb17461a12db5','fooz','aes'
),'UTF8' );

(sorry for bothering).

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Krzysztof Nienartowicz 2012-04-23 13:42:40 Namespace of array of user defined types is confused by the parser in insert?
Previous Message Tomas Vondra 2012-04-23 12:11:28 Re: What is the different between pg_trgm search and FULL Text search?