I'm posting a pair of patches to make phpBB2Drupal compatible with PostgreSQL databases running phpBB forums. Well, almost entirely compatible. I don't know why poll importing is throwing key violation errors on the poll table, and I'm unsure of private message importing as of yet.

These patches are based on the 2006-08-21 cvs version of the software.

First, the .install patch which gives correct sql syntax for creating the tables in a postgresql drupal install:

Comments

PMunn’s picture

StatusFileSize
new10.19 KB

And here is the module patch.

-Most queries with double-quoted strings in them are now using single quoted strings.
-Many inserted fields are now substr'd down to the maximum size of the column in the db table. PostgreSQL throws errors if you try to insert something too big into a table, it doesn't quietly truncate it.
-An IF in a privmsgs query has been turned into a CASE compatible with both PostgreSQL and MySQL (according to MySQL's manual anyway).
-A left join in that same query has been modified to not put parentheses around a table reference.
-A nonstandard insert which INSERTed several rows at once into profile_fields by putting commas between the sets has been broken into multiple INSERTs using a variable to hold the repeating initial part of the query.
-The insert into poll_votes was putting an empty string in the hostname field which required a value. I've modified it to write in "NA" instead.

I haven't tested this patch on mysql.

PMunn’s picture

Title: PostgreSQL compatibility patches. » phpbb2drupal PostgreSQL compatibility patches.

I've taken a closer look at my testing database and found the Private Message import worked without issue. That leaves the polls importing issue.

beginner’s picture

Thanks for your patches and the detailed description.

I have just committed the .install patch.
You forgot to add the curly brackets around the table names {}.
I have added them around the table names and around the table key names in a second patch: http://drupal.org/cvs?commit=42166

beginner’s picture

Status: Needs review » Fixed

Your second patch is committed, too.
I tested it with mysql, and it seems to work as before.
Thanks again both for the patches, and for the detailed comments.

Anonymous’s picture

Status: Fixed » Closed (fixed)