Re: [SQL] Storing null bytes in bytea

2009-04-28 Thread Andy Shellam
Hi Tom, Your example works fine in psql: regression=# create table t1 (f1 bytea); CREATE TABLE regression=# insert into t1 values (E'IsLoggedIn|b:1;CurrentUser|O:17:"Class_SystemUser":4:{s:26:"\\000Class_SystemUser}'::bytea); INSERT 0 1 regression=# select * from t1;

Re: [SQL] Storing null bytes in bytea

2009-04-27 Thread Tom Lane
Andy Shellam writes: > Because of the nul bytes, I've set the session_data column to be a bytea > column in my database table. However I cannot get PostgreSQL to read > past the first nul byte on an insert, so the unserialize call fails when > it reads it back out the database and the remainin

[SQL] Storing null bytes in bytea

2009-04-27 Thread Andy Shellam
Hi all, I was going to post this on the pgsql-php list but I think the issue is more on the PostgreSQL side of things. I'm using PHP 5.2.9 connected to a PostgreSQL 8.3.7 server running on Solaris 10 to try to store the session data for an application using a custom session handler class. T