Re: Pgcrypto install (I've tried multiple ways)

From: Michael Wood <esiotrot(at)gmail(dot)com>
To: David Patricola <david(dot)patricola(at)jefferson(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Pgcrypto install (I've tried multiple ways)
Date: 2011-01-28 13:55:33
Message-ID: AANLkTimvewtRicYyEb0Nw5v_MgZXvxUV_cbeykz1ONTC@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 28 January 2011 02:06, David Patricola <david(dot)patricola(at)jefferson(dot)edu> wrote:
> What I have to do is store multiple fields encrypted from user input, them
> decrypt them for retrieval to the browser.  Is there a preferred way to do
> this?

Try creating a column with type "bytea" and store the results of the
encrypt() in there. Then use that column with decrypt(). (Or alter
the type of your existing "thenotes" column from varchar to bytea.)

See also:

http://www.postgresql.org/docs/9.0/static/datatype-binary.html

Note: I've never used pgcrypt.

--
Michael Wood <esiotrot(at)gmail(dot)com>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2011-01-28 15:30:34 Re: Set default time zone for displaying dates in a session
Previous Message Lew 2011-01-28 11:39:33 Re: Unique constraint on only some of the rows