pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Raymond O'Donnell <rod@iol.ie>
To: elmarkivp <elmarkivo@hotmail.com>
Cc: pgsql-php@postgresql.org
Subject: Re: store data files encryptypted in database.
Date: Fri, 10 Oct 2008 16:39:48 +0100
Message-ID: <48EF7744.2010108@iol.ie> (raw)
In-Reply-To: <BAY108-DAV74F0B81BD22FF982A3641A3350@phx.gbl>
References: <BAY108-DAV74F0B81BD22FF982A3641A3350@phx.gbl>

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@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------



view thread (5+ messages)  latest in thread

Message-ID: <48EF7744.2010108@iol.ie>
Permalink:  ../48EF7744.2010108@iol.ie/
Also on:    postgresql.org/message-id/48EF7744.2010108@iol.ie

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: rod@iol.ie, elmarkivo@hotmail.com
  Subject: Re: store data files encryptypted in database.
  In-Reply-To: <48EF7744.2010108@iol.ie>
  References: <BAY108-DAV74F0B81BD22FF982A3641A3350@phx.gbl> <48EF7744.2010108@iol.ie>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox