Search Postgresql Archives

Re: Problems with pgcrypto and special characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux