Skip to content
 

PG4WP 1.0.0

Yes ! PostgreSQL for WordPress 1.0.0 is out :)

This means I think the code is stable enough to be used in the real world ;)

I optimized a bit the code, mainly to have often used code reached faster.

Another big change is in the size of ‘db.php’ that cuts down from about 32kB to less than 1kB.
It was initially a copy of WordPress’ ‘wp-db.php’ with some changes in it, now it loads up the file from your WordPress installation making any needed change “on the fly”.
The main advantage is that I don’t have to keep my version in sync with WordPress’ one.
Please be warned that this new method requires PHP 4.3+ to work, so this becomes the minimal requirement (anyway you shouldn’t use an older version of PHP).

I’ve also changed the directory structure, so that the ‘pg4wp’ directory goes directly in ‘wp-content’ instead of going into the ‘wp-content/plugins’ subdir.
This is because PG4WP is not really a plugin, you need it to be installed and running before any plugin can be loaded.

If you enable debug logging, the log files are now written into ‘pg4wp’.

A ‘readme.txt’ file is included in the zip, describing PG4WP for the plugin directory at WordPress.Org
I’m still waiting for my account there to put PG4WP.

I use PG4WP to run this blog since I opened it, and encountered no real problem with it (only “not working features” that I corrected since then).

If you use PG4WP to run your blog (in fact this is true even if you don’t use PG4WP), don’t forget to make regular backups (and verify that you’ll be able to restore them in case anything goes wrong), ‘pg_dump’ is your friend if you are running PostgreSQL ;)

If you installed any previous version, don’t forget to remove the ‘pg4wp’ directory from your ‘wp-content/plugins’ directory as this one is no more used.

Download :

PG4WP 1.0.0

7 Comments

  1. Ed W says:

    Great stuff for working on this!

    I did attempt to get PG4WP working on a fresh install and for some reason the install.php just comes out as a blank page.
    (The same install works ok with MySQL)

    It’d be great if I can get this working though as it’s not ideal to have to have MySQL and PostgreSQL both running on my server!

  2. Inside install.txt
    DB_TYPE should be DB_DRIVER
    and db.php in the directory listing should be prefixed just like the rest of the files in that directory

    Apart from that WELL DONE!!!

  3. Serge Fonville says:

    I tried to install GD Star Rating http://wordpress.org/extend/plugins/gd-star-rating/ and it generated a lot of errors
    Do you have any experience with this plugin. Alternatively, do you know another rating plugin that is compatible with pg4wp

    Thansk

  4. Hawk__ says:

    I’m sorry but most database intensive plugins have poor chances to work correctly with PG4WP as it works by “translating” MySQL specific queries to more generalistic SQL ones.

    Plugins using direct my calls will never be supported as long as they are not modified to use WP’s “wpdb” database object which PG4WP hooks into.

    GD Star Rating seems to use many tables but may be supported some day if it uses the “wpdb” database object to work (I’ll put it in the list of plugins to watch for compatibility).
    I don’t have much experience with WP’s plugins, and I don’t know any rating plugin.

    Please excuse the delay for my answer.

  5. Hello Hawk__,

    I am attempting to get your plugin working. I have downloaded a clean copy of WordPress 2.8 (released June 2009) and followed the directions in the readme file for PG4WP. I have created a database with the database user as owner and I have double-checked the database name, user name, and password information for my server. When I attempt to go through the installation process, I see a “Can’t select database” error generated by Wordpress. It says that it was able to connect so the username and password are fine, but that it cannot select the database. Any advice/ideas?

    Again, I do not have any additional Wordpress plugins and this is a clean install attempt. I am running Apache, PostgreSQL 8.3 and PHP5. The server is a deployed web server with other content running on it just fine (including use of another PostgreSQL database). The Wordpress PostreSQL user is the owner of the database I am trying to use.

  6. rach says:

    Great stuff!

    But, i need help…

    i have downloaded a clean copy of wordcpress 2.8.6 and followed all the directions in the file readme PG4WP, but some reason the install.php just comes out as a blank page.

    cheack: http://oqueeutenho.uol.com.br/2.0/

    please help?

    thanks…

  7. balrog-kun says:

    Hey,
    I just installed wordpress for the first time and wanted to use PostgreSQL. I started with the latest wordpress 2.9.1 + your plugin which nearly worked fine but pgsql threw a bunch of syntax errors at me. Some related to the REGEXP keyword, some related to new primary key conflicts and some related to ON DUPLICATE KEY keyword. I modified your plugin to handle these cases (except the last one which I chose to ignore for simplicity) and it works like a charm, I’m blogging away. The patch against pg4wp 1.0.0 is at

    http://www.openstreetmap.pl/balrog/wordpress-pg4wp-update-2.9.1.patch

Leave a Reply