1 (edited by citanul 2012-09-03 07:47)

Topic: PostgreSQL woes

I tried making a new installation using PostgreSQL 9.2RC1... first by creating an UTF-8 formatted database.

I get many variations of this error on the PHP logs:

[03-Sep-2012 05:51:03 UTC] PHP Strict Standards:  Resource ID#41 used as offset, casting to integer (41) in ...../punbb/include/dblayer/pgsql.php on line 123 

...and the post and topic counter at the bottom of the forum front page doesn't change even when I post or make new threads.

The above was part of a test. For my forum, I converted the database from MySQL and also got all of the above problems, as well as these:

After importing the pun_pm_messages table from my old MySQL database to Postgres, this error appeared whenever someone tries to send a PM:

Sorry! The page could not be loaded.

This is probably a temporary error. Just refresh the page and retry. If problem continues, please check back in 5-10 minutes.

...but it seemed to disappear after I deleted everything from the table, and worked fine again... but I couldn't see anything really wrong with the imported table.

I also got this "temporary" error once while trying to create a topic with a poll.

There are no apparently relevant PHP errors for these last two problems, or I've missed them. I'll try increasing database logging verbosity and see if I find anything else of use there.

2 (edited by citanul 2012-09-03 21:24)

Re: PostgreSQL woes

I just forgot to update the sequences for all the tables that needed them; that's why stuff didn't work.

I still get the "strict standard" errors; however, everything else is fixed.

These are the queries I had to do to solve the EXTENSION problems: (with voting and PMs):

SELECT pg_catalog.setval('voting_id_seq', (SELECT MAX(id) FROM voting), true);
SELECT pg_catalog.setval('answers_id_seq', (SELECT MAX(id) FROM answers), true);
SELECT pg_catalog.setval('pun_pm_messages_id_seq', (SELECT MAX(id) FROM pun_pm_messages), true);

I suppose it wouldn't hurt to repeat this for every table that has an id_seq "counterpart" (on the psql client the "command" \d lists tables), but I just did it for every table that caused problems, besides doing it originally for the ones shown in a tutorial.

I guess this thread could be moved to troubleshooting, except I still get the resource ID errors, which also seem to be unrelated to the post count at the bottom front page, which still updates (although not immediately).