Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6369837C691 for ; Fri, 10 Oct 2008 13:10:41 -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 35906-06 for ; Fri, 10 Oct 2008 13:10:33 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from bay0-omc2-s41.bay0.hotmail.com (bay0-omc2-s41.bay0.hotmail.com [65.54.246.177]) by postgresql.org (Postfix) with ESMTP id 62F0237C055 for ; Fri, 10 Oct 2008 13:10:33 -0300 (ADT) Received: from hotmail.com ([65.54.162.80]) by bay0-omc2-s41.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 10 Oct 2008 09:10:31 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 10 Oct 2008 09:10:31 -0700 Message-ID: Received: from 190.3.112.90 by BAY108-DAV8.phx.gbl with DAV; Fri, 10 Oct 2008 16:10:26 +0000 X-Originating-IP: [190.3.112.90] X-Originating-Email: [elmarkivo@hotmail.com] X-Sender: elmarkivo@hotmail.com From: "elmarkivp" To: Cc: References: <48EF7744.2010108@iol.ie> Subject: Re: store data files encryptypted in database. Date: Fri, 10 Oct 2008 13:10:29 -0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-OriginalArrivalTime: 10 Oct 2008 16:10:31.0229 (UTC) FILETIME=[B7E266D0:01C92AF2] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=STOX_REPLY_TYPE=0.001 X-Spam-Level: X-Archive-Number: 200810/3 X-Sequence-Number: 3900 i have quoted $file and now thi is what happend... $sql = "INSERT INTO SOME_TABLE (bytea_file) VALUES (pgp_sym_decrypt_bytea('$file','somepass','cipher-algo=aes256'))"; ERROR: function pgp_sym_encrypt_bytea("unknown", "unknown", "unknown") does not exist HINT: No function matches the given name and argument types. You may need to add explicit type casts so... with $sql = "INSERT INTO SOME_TABLE (bytea_file) VALUES (pgp_sym_decrypt_bytea('$file'::bytea,'somepass'::text,'cipher-algo=aes256'::text))"; ERROR: function pgp_sym_encrypt_bytea(bytea, text, text) does not exist HINT: No function matches the given name and argument types. You may need to add explicit type casts. any idea? ----- Original Message ----- From: "Raymond O'Donnell" To: "elmarkivp" Cc: Sent: Friday, October 10, 2008 12:39 PM Subject: Re: [PHP] store data files encryptypted in database. > 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 > ------------------------------------------------------------------ > > -- > Sent via pgsql-php mailing list (pgsql-php@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-php >