Skip to content
 

PG4WP and WPMU ready for a test run

If you ever wanted to run WordPress Multisite with PostgreSQL, it’s time to make a test run with the latest development version of PG4WP.

I’ve made changes so that everything seems to go fine (at least in « subdirectory » mode).

If you happen to try it, please file a report by commenting on this article.
Please don’t forget to indicate the following elements :
- PHP version
- PostgreSQL version
- WordPress version
- which mode you tested (« subdomain » or « subdirectory »)

To download the latest development version of PG4WP just click here

11 commentaires

  1. Frank dit :

    Hi!

    I’m just switching my mysql WordPress to Postgres. I have a small MU subdomain installation. It seems to work fine, I just have the problem with « Domain Mapping MU ». It just recreates it’s table every time:

    [1337277267.3123] Error running :
    CREATE TABLE IF NOT EXISTS `wp_domain_mapping` (
    `id` bigint(20) NOT NULL auto_increment,
    `blog_id` bigint(20) NOT NULL,
    `domain` varchar(255) NOT NULL,
    `active` tinyint(4) default ’1′,
    PRIMARY KEY (`id`),
    KEY `blog_id` (`blog_id`,`domain`,`active`)
    );
    —- converted to —-
    CREATE TABLE IF NOT EXISTS wp_domain_mapping (
    id bigint NOT NULL DEFAULT nextval(‘IF_seq’::text),
    blog_id bigint NOT NULL,
    domain varchar(255) NOT NULL,
    active tinysmallint default ’1′,
    PRIMARY KEY (id),
    KEY blog_id (blog_id,domain,active)
    );;
    CREATE SEQUENCE IF_seq;
    —-> ERROR: syntax error at or near « NOT »
    LINE 1: CREATE TABLE IF NOT EXISTS wp_domain_mapping (
    ^
    ———————
    [1337277267.3132] Error running :
    CREATE TABLE IF NOT EXISTS `wp_domain_mapping_logins` (
    ^
    ———————

  2. Hawk__ dit :

    Thank you for your feedback.
    I’ve analysed the code of « Domain Mapping MU » and I don’t understand why the author used the « IF NOT EXISTS » MYSQLism as he first check if the table exists before calling CREATE TABLE.

    Anyway, I’ve introduced a filter in the development version of PG4WP to resolve the particular problem you encounter, so you should try again :)

  3. Frank dit :

    That was fast…

    wp-photo-album-plus and broken-link-checker are problematic, too…

  4. Yuri dit :

    Hi, I’ve just installed last development version of your plugin.
    WordPress installation went well.

    I’ve found a bug in wp_terms table. But I don’t understand if it’s related to this plugin.
    I try to add a new category (I’ve only ‘uncategorized’), and I get the following error:

    Error running :
    INSERT INTO `wp_terms` (`name`,`slug`,`term_group`) VALUES (‘Wordpress’,’wordpress’,’0′)
    —- converted to —-
    INSERT INTO wp_terms (name,slug,term_group) VALUES (‘Wordpress’,’wordpress’,’0′)
    —-> ERROR: duplicate key value violates unique constraint « wp_terms_pkey »

    By looking into wp_terms table from pgAdmin, I see two records: uncategorized and blogroll.
    While last used value for term_id field is 2, wp_terms_seq value is only 1, so the first INSERT in wp_terms fails.

    I’ve repeated the installation process 3 times, with the same result.

    My server data:
    - PHP version: 5.3.2
    - PostgreSQL version: 8.4.11
    - WordPress version: 3.3.2
    - subdomain installation

  5. Frank dit :

    @Yuri: you can change the sequence to start with the right number with « SELECT setval(wp_terms_seq,2) » – it’s a workaround, though.

  6. Hawk__ dit :

    @Yuri : Thank you for your report.

    This problem IS related to PG4WP.
    It seems (from your report) that wp_terms_seq is not correctly initialized upon installation, I’ll dig into this this problem and try to solve it from PG4WP directly.

    In the meantime, you should be able to update wp_terms_seq by running the following SQL statement just as Frank suggested (here is a more generalistic query) :
    `SELECT setval(‘wp_terms_seq’, (SELECT MAX(term_id) FROM wp_terms)+1);`

    This will fix the value of the sequence.

  7. Hawk__ dit :

    @Frank : I won’t integrate any other hack for plugins support into PG4WP for now (there are so many of them, this would make PG4WP a big piece of unmaintainable code in the long term).

    I intend to work on a mechanism that allows creating one file per plugin to support and then just drop that file in a specific subfolder.

  8. netllama dit :

    Hi!
    I’m a long time user of your excellent PG4WP. I recently upgraded my server to PostgreSQL-9.1.3 (from 9.0.6), and grabbed the latest development version of PG4WP.

    I have a super old Movable Type blog that I’m trying to import into my WordPress-3.3.2 blog with with movabletype-importer plugin ( http://wordpress.org/extend/plugins/movabletype-importer ). The plugin seems to be mostly working, but in my postgresql server log, I’m seeing tons of errors whenever it tries to import an a blog entry that happens to have a single quote in its title:

    ###############
    ERROR: syntax error at or near « m » at character 102
    STATEMENT: SELECT « ID » FROM wp_posts WHERE 1=1 AND post_date = ’2004-12-02 16:34:59′ AND post_title = ‘help, i\’m drowning’
    ERROR: duplicate key value violates unique constraint « wp_terms_pkey »
    DETAIL: Key (term_id)=(1) already exists.
    STATEMENT: INSERT INTO wp_terms (name,slug,term_group) VALUES (‘work’,’work’,’0′)
    ERROR: duplicate key value violates unique constraint « wp_terms_pkey »
    DETAIL: Key (term_id)=(2) already exists.
    STATEMENT: INSERT INTO wp_terms (name,slug,term_group) VALUES (‘work’,’work’,’0′)
    ERROR: syntax error at or near « t » at character 108
    STATEMENT: SELECT « ID » FROM wp_posts WHERE 1=1 AND post_date = ’2005-05-26 18:12:52′ AND post_title = ‘now that wasn\’t so bad’
    ERROR: syntax error at or near « s » at character 98
    STATEMENT: SELECT « ID » FROM wp_posts WHERE 1=1 AND post_date = ’2005-07-01 17:25:41′ AND post_title = ‘let\’s not do that again, ok?’
    ERROR: syntax error at or near « m » at character 96
    STATEMENT: SELECT « ID » FROM wp_posts WHERE 1=1 AND post_date = ’2005-10-21 17:55:59′ AND post_title = ‘i\’m not amused’
    ERROR: syntax error at or near « s » at character 105
    STATEMENT: SELECT « ID » FROM wp_posts WHERE 1=1 AND post_date = ’2005-12-13 18:50:40′ AND post_title = ‘zzzzzzzzzz\’s’
    ERROR: syntax error at or near « m » at character 96
    STATEMENT: SELECT « ID » FROM wp_posts WHERE 1=1 AND post_date = ’2005-12-30 09:15:43′ AND post_title = ‘i\’m back’
    ERROR: syntax error at or near « you » at character 95
    STATEMENT: SELECT « ID » FROM wp_posts WHERE 1=1 AND post_date = ’2006-01-02 14:34:47′ AND post_title = ‘\’you have mail\’ x 1259′
    ERROR: syntax error at or near « d » at character 100
    STATEMENT: SELECT « ID » FROM wp_posts WHERE 1=1 AND post_date = ’2006-01-10 18:49:43′ AND post_title = ‘where\’d all the cars go?’
    ERROR: syntax error at or near « m » at character 103
    STATEMENT: SELECT « ID » FROM wp_posts WHERE 1=1 AND post_date = ’2006-03-11 07:44:51′ AND post_title = ‘ok, so I\’m an idiot’
    ERROR: syntax error at or near « s » at character 100
    STATEMENT: SELECT « ID » FROM wp_posts WHERE 1=1 AND post_date = ’2006-03-12 18:41:38′ AND post_title = ‘where\’s my 6 months of sun?’
    #############

    Is this something that can be fixed?

    thanks!

  9. Hawk__ dit :

    I never really worked on importing data in WordPress with PG4WP, but I think the problems in your report can be quite easily fixed.

    First you have the same problem as reported by Yuri, which can be fixed by running `SELECT setval(‘wp_terms_seq’, (SELECT MAX(id) FROM wp_terms)+1);` just after you run WordPress’ installation process.

    The second problem is linked with the hack for PostgreSQL 9.1+ support, which only applies to `INSERT` and `UPDATE` queries in the development tree of PG4WP.
    I’ve just modified PG4WP to correct this problem.

    UPDATE : PG4WP 1.3.0b1 fix the 2 issues you are encountering, so you should give it a try.

  10. netllama dit :

    Thanks, I’ve grabbed the latest version!

  11. Yuri dit :

    @Hawk, @Frank:
    Thank you both, I forgot to say I already used the manual increment workaround myself. Sorry…

    @Hawk:
    I just reinstalled WP with the new version of your plugin. The wp_terms_seq issue is fixed. No new problems to report at the mement.
    Thank you again.