There are many more problems than you mentioned. It seems that the PostgreSQL support philosophy was "let's just point all the code to the pgsql driver in the DSN and it will work." This is definetly wrong. I went through the trouble of patching most of the PostgeSQL related bugs this morning, when I installed the software after reading it on Slashdot but sadly, these patches break the MySQL functionality.

It seem that the approach described above is a minor and easily fixable architecture flaw in this piece of software. The assumption that has to be made is that MySQL is not compatible with PostgreSQL on many levels and that logic has to be separated. This can become a bit tricky because a most of the queries are built by a function.

Anyways, attached are my patches... well more like drop-in replacements to the latest source code that fix PostgreSQL bugs.





On 10/13/05, Bennett, Steve <s.bennett@lancaster.ac.uk> wrote:
Hi list,

I've just started playing with RoundCube, looks great so far..!

I can't see a list archive, so maybe some of this has already been
discussed, but I'm seeing some issues using RoundCube with a pgsql
database:

Some of the queries use backticks to quote column names - pgsql uses
double quotes. Given that "default" is a bit of a tricky name to use for
a column, is it worth renaming it, rather than doing lots of tricky code
to make sure the quotes are right for the database? The same probably
goes for column names like "language" and "reply-to".

My install of PostgreSQL (v8.0.1) doesn't have a function named
unix_timestamp(). I hacked one up as:
  CREATE OR REPLACE FUNCTION unix_timestamp(TIMESTAMP WITH TIME ZONE)
  RETURNS INTEGER AS '
  BEGIN
      RETURN round(EXTRACT( EPOCH FROM $1 ));
  END;
  ' LANGUAGE 'plpgsql';

I get errors if I leave caching enabled - I've just turned it off for
now, but I'm guessing that the serialised data contains something that
pgsql doesn't like.

Amongst the spam and assorted junk that is my inbox, I have a message
with no Date header. RoundCube generated errors for that too. The
following seems to do the trick:

--- program/include/main.inc.orig
+++ program/include/main.inc
@@ -890,7 +890,9 @@
   {
   global $CONFIG, $sess_user_lang;

-  if (is_numeric($date))
+  if ($date == "")
+    return "";
+  elseif (is_numeric($date))
     $ts = $date;
   else
     $ts = strtotime($date);


Cheers,

Steve Bennett