hi, i'm trying to store data files encryptypted in
postgres 8.1 database but i can`t make it works.
this is what i'm doing.
$link = pg_connect("host=$dbhost user=$dbuser
password=$dbpwd dbname=$dbname") or die(pg_last_error($link));
$fp = fopen($tmp_name, "rb");
$file= fread($fp,
filesize($tmp_name));
fclose($fp); $file=pg_escape_bytea($file);
$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)
it seems that whant to the $file be a
column ... but thats not what the documentation says...
F.20.3.2. |