Re: store data files encryptypted in database.

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: elmarkivp <elmarkivo(at)hotmail(dot)com>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: store data files encryptypted in database.
Date: 2008-10-10 15:39:48
Message-ID: 48EF7744.2010108@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

On 10/10/2008 16:32, elmarkivp wrote:
> $sql = "INSERT INTO SOME_TABLE (bytea_file) VALUES
> (pgp_sym_decrypt_bytea($file,somepass,cipher-algo=aes256))";
> pg_query($link, $sql) or die(pg_last_error($link));
>
> this error appear...
>
> ERROR: column "content_of_bytea_file" does not exist (
> "content_of_bytea_file" is $file)

At a guess, you need to quote the contents of $file in order to get PG
to treat it as a string. If you don't, PG sees it as a column name,
hence the error you're seeing.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message elmarkivp 2008-10-10 16:10:29 Re: store data files encryptypted in database.
Previous Message elmarkivp 2008-10-10 15:32:28 store data files encryptypted in database.