Re: [general] Error while decrypting using pgp

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: VENKTESH GUTTEDAR <venkteshguttedar(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: [general] Error while decrypting using pgp
Date: 2014-11-19 17:31:50
Message-ID: CAMkU=1wEFfTwv-DwBeo9rVM3Vc_gDmjajvBPO-1kpr17Wyf9Vw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Nov 19, 2014 at 2:49 AM, VENKTESH GUTTEDAR <
venkteshguttedar(at)gmail(dot)com> wrote:

>
> i am getting this error
>
> ERROR: function pgp_sym_decrypt(character varying, text) does not
> exist
> LINE 1: SELECT pgp_sym_decrypt(phone_no, keys.privkey),
> pgp_sym_decrypt(us...
>

The encrypted message needs to be binary data, bytea. You can cast it to
bytea, like:

pgp_sym_decrypt(phone_no::bytea, keys.privkey)

But really the column phone_no should be of type bytea to start with.

Cheers,

Jeff

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2014-11-19 18:21:00 Re: Performance question
Previous Message Jonathan Vanasco 2014-11-19 16:54:33 Re: issue with double ordering in a wrapped distinct