Andy Burns wrote:
Hi,
managed to get roundcube working with postgres from the first cvs snapshot last year (took some minor tweaks), noticed a new snapshot so thought I'd check it out again.
I cleaned out all tables/sequences from my old database.
There is one typo in the postgres_initial.sql file on the messages table the session_id should refer to foreign key "sess_id" in the sessions table, not to "session_id" which doesn't exist.
With that done, and changes made to config/db.inc.php and config/main.inc.php
I can log in to roundcube ok, but when rcube_imap.inc is populating the messages table I get lots of errors like
DB Error: unknown error Query: INSERT INTO messages (user_id, del, cache_key, created, idx, uid, subject, "from", "to", cc, date, size, headers) VALUES ('1', 0, 'INBOX.msg', now(), '787', '33125', '[LinuxFailSafe] Re: LinuxFailSafe Digest, Vol 3, Issue 1', 'David Brower ', 'linuxfailsafe@lists.community.tummy.com', FALSE, '2006-02-10 19:48:40', 5381, 'O:14:"iilbasicheader":25:{s:2:"id";s:3:"787";s:3:"uid";s:5:"33125";s:7:"subject";s:56:"[LinuxFailSafe] Re: LinuxFailSafe Digest, Vol 3, Issue 1";s:4:"from";s:38:"Da
According to the PHP manual, substr() should always return a string. However, I changed the code and added a casting for the return value of $this->decode_header(). This should now fix this problem.
I've looked at where this query is built up, is it possible that the substr($this->decode_header((string)$headers->cc, TRUE), 0, 128) is returning "FALSE" instead of an empty string when cc: from header is blank? see the FALSE between the "tummy.com" and the date?
I also tried usign MDB2 instead of DB2 but got errors about prepare() function not existing, I tried to revert it to just use execute() instead of prepare+execute but didn't help.
MDB2 support is currently broken. There have been some changes to the rcube_db class which haven't been applied to the rcube_mdb2 class.
I know this is still pre-beta, but I thought postgres support was supposed to actually work now?
I is but I'm not very familiar with Postgres but tested it successfully on my machine. Suggestions to for Postgres support are always welcome!
Regards, Thomas