WordPress 3.9.1 with PostgreSQL

Till 3.8 everything was ok and my blog survived every update. But for 3.9 this changed as the postgresql driver I am using (PG4WP)is not compatible out of the box anymore. There were no updates for the last two years. Here are the two fixes I had to make:

To resolve the error “Call to undefined function wpsql_errno()” I added the following code at the end of the file wp-content/pg4wp/driver_pgsql.php:

The second error to resolve was “Missing argument 3 for wpsql_result()”. To fix this I replaced the function wpsql_result in the file “wp-content/pg4wp/driver_pgsql.php” on line 58-59:

After these two changes my blog is running again with new wordpress version =)

See http://blog.coffeebeans.at/?p=813 for a fixed version.

WordPress problem with PostgreSQL

I found strange errors like the following in my apache_error.log

I found out that this comes from line 1178 in wp-includes/link-template.php. Just change the p.id at after the SELECT to p.ID and save the file (SELECT p.ID …). That’s the trick.