Hi
I've been fooling a bit around with the 'bytea' datatype in Postgres for some hours now, but I cant really make it work...
I tried the exact same code on my homepc (WinXP, php 5.0.4 & pgsql 8.1.14) and here all goes well, but in my test enviroment (described below) the row is being inserted but with the bytea field empty..
Im running this from a webserver on FC linux (apache 2.0.54, php 5.0.4), and using a pgsql server on another FC linux (pgsql 8.1.4).
I created a table w those fields: name => text, pic => bytea, no constraints, nothing.
Loaded a file manually in php and ran this:
// test for bytea
$dbconn = pg_connect('host=dev02 port=5432 dbname=testing user=tester');
$data = file_get_contents('./test.jpg');
$escaped = pg_escape_bytea($data);
//$escaped = 'testing..'; // this will work though
pg_query('INSERT INTO public."TESTByteA" ("name", "pic") VALUES (\'asd\', \''. $escaped .'\');');
die('done, row should exist now?');
I've not set up this test env so I dont know if special configs are used, but I can get them if nessecary..
So, out of curiosity, can this somehow be disabled or are there something else I've missed? 😕