PostgreSQL for WordPress

PostgreSQL for WordPress (or PG4WP) is a plugin to install and use WordPress with a PostgreSQL database.

Development is done with WordPress version 2.8  but it may work with other versions too.

The original code was inspired by usleepless’ script “mysql2pgsql.php” and has evolved to become compatible with newer versions of WordPress and PostgreSQL.

PG4WP rewrites the SQL code on the fly and makes the call to the native function adequately in place of the “mysql_*()” initial call.

The plugin is based on a wpdb class identical to the WordPress’ one, except that all calls to “mysql_*()” are renamed “wpsql_*()”, and the “converter ” defines these “wpsql_*()” functions.
You don’t need to disabled MySQL support in PHP to use a “converter” for a particular database and MySQL support is still available (the MySQL “converter” is included).

The WordPress core works, but there was very little testing.
If you test it (successfully or not) , I’d like to be informed of the results.

Plugins using WordPress’ wpdb with standard SQL should work without modification.

If you use a plugin successfully (or not) , please leave a comment.

If a plugin you wish to use doesn’t work and you think PG4WP is the cause, please leave a comment and I’ll try fix the problem.

You can download the latest version of PG4WP from the plugin directory

3 Comments

  1. Blayne says:

    Thanks! My school linux server only uses postgres so this is a huge help and seems to be working perfectly!!!

  2. Blayne says:

    Although its a tad slow :-/ Probly just a server issue.

  3. Hawk__ says:

    Nice to hear it helped you.

    Maybe you could give me some informations about your setup (Wordpress version, PostgreSQL version, maybe Web server version and PHP version, …).

    v1.0 was intended to “just work”, I know there are some bottlenecks in the code and the next step will be to optimize almost everything.

    I have some ideas, such as separating “setup” code from “daily usage” code.
    This would mainly reduce memory footprint but may also give a little speed boost.

    I’ll make some code profiling in the next few days so that I can determine which part of my own code is the slowest, and try to make it a little faster.

Leave a Reply