Wordpress with PostreSQL

Posted at 11:36:14 AM in Installations (50) | Read count: 2457

I noticed a few things after my installation of Wordpress with PostgreSQL as the data backend. I used pg4wp, found on this site. I downloaded the latest version 1.2.2 but got errors during the installation, but Wordpress indicated it had installed successfully, so I didn't worry about it too much. Then as I was trying to add categories, the new categories wouldn't show up. I had enabled PG4WP_DEBUG and reviewed the log files. 

The first problem was a duplicate key which violated the unique constraint on the table ??_terms. (?? is modified to whatever you set your name prefix to in the wp-config.php file.) The first thing I noticed is that the table is used to terms from different areas of Wordpress. It holds the category of posts and well as the category of links. This table is initially populated with uncategorized and Blogroll. Apparently during installation, the sequence tracker stopped at 2 and the number being assigned is the number currently held by the tracker. So a new record wanted to be id number 2 but 2 was already in the table. To fix this, I just went into the sequence tracker (??_terms_seq) and set the next number to assign to 3 and the problem was solved.

I only recently started working with users. I thought it was odd that the user counts would work, but I could see the actual user records. The page always had the message "No matching users were found!". Even after I added users, it gave me the same message. Oddly enough, there are two meta tables associated with the users table and apparently, the counts come from ??_users, but the actual display comes from one of the meta tables. Again, I looked in the error log. This message was the cause:

SELECT DISTINCT(wp_users."ID" ) FROM wp_users WHERE 1=1 ORDER BY user_login LI$
----
ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

This is apparently a common problem in the pg4wp, but isn't addressed on their web site. I found a solution here. I just installed it and I can now see the users. I haven't fully tested it yet. I tried to add the line he said would fix the problem, but it broke the home page. I downloaded his driver_pgsql.php and installed it in place of the one provided by pg4wp and was able to get to the users. The install of course changed the ownership and file rights which I had to manually change after uploading the file.

Two changes:

chown www-data:root driver-pgsql.php 

chmod 777 driver-pgsql.php

This is my second site on the same server. I found that sub domains and/or sub-folders is not what I needed. Networks or WordpressMU (multi site) wasn't the answer.

Written by Leonard Rogers on Monday, October 24, 2011 | Comments (0)


    Name
    URL
    Email
    Email address is not published
    Remember Me
    Comments

    CAPTCHA Reload
    Write the characters in the image above