I would like to store a compressed string (XML) in my PostgreSQL table. So
far, I have been unsuccessful in uncompressing the data that I insert.
echo gzuncompress(gzcompress('this is a test'));
But when i store the gzcompressed data in the table, the data that is
returned from a SELECT call does not match and the call to gzuncompress
throws a "data error" warning. I have tried storing in both text and bytea
The problem appears to be in the escaping. For example, with bytea:
$data = gzcompress('this is a test');
$data2 = pg_unescape_bytea(pg_escape_bytea($data));
$data does not equal $data2.
And with a 'text' column type, i use pg_escape_string() and the returned
column value does not match.
Am i doing something wrong? Is there an easier way?
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php