Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 2636437C6E0 for ; Fri, 10 Oct 2008 12:39:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 30909-05 for ; Fri, 10 Oct 2008 12:39:49 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail23.svc.cra.dublin.eircom.net (mail23.svc.cra.dublin.eircom.net [159.134.118.145]) by postgresql.org (Postfix) with SMTP id 80A0D37C046 for ; Fri, 10 Oct 2008 12:39:49 -0300 (ADT) Received: (qmail 74625 messnum 8282876 invoked from network[86.46.57.34/unknown]); 10 Oct 2008 15:39:47 -0000 Received: from unknown (HELO ?127.0.0.1?) (86.46.57.34) by mail23.svc.cra.dublin.eircom.net (qp 74625) with SMTP; 10 Oct 2008 15:39:47 -0000 Message-ID: <48EF7744.2010108@iol.ie> Date: Fri, 10 Oct 2008 16:39:48 +0100 From: Raymond O'Donnell Reply-To: rod@iol.ie User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: elmarkivp CC: pgsql-php@postgresql.org Subject: Re: store data files encryptypted in database. References: In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 081009-1, 09/10/2008), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/2 X-Sequence-Number: 3899 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 ------------------------------------------------------------------