Skip site navigation (1) Skip section navigation (2)

Re: store data files encryptypted in database.

From: "elmarkivp" <elmarkivo(at)hotmail(dot)com>
To: <rod(at)iol(dot)ie>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: store data files encryptypted in database.
Date: 2008-10-10 16:10:29
Message-ID: BAY108-DAV8D4136F45234D04D6D0FBA3350@phx.gbl (view raw or flat)
Thread:
Lists: pgsql-php
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" <rod(at)iol(dot)ie>
To: "elmarkivp" <elmarkivo(at)hotmail(dot)com>
Cc: <pgsql-php(at)postgresql(dot)org>
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(at)iol(dot)ie
> Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
> ------------------------------------------------------------------
>
> -- 
> Sent via pgsql-php mailing list (pgsql-php(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-php
> 


In response to

pgsql-php by date

Next:From: Frank BaxDate: 2008-10-10 16:26:47
Subject: Re: store data files encryptypted in database.
Previous:From: Raymond O'DonnellDate: 2008-10-10 15:39:48
Subject: Re: store data files encryptypted in database.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group