My environment
drupal: 4.6.5
DB: postgresql 7.4.7 (patched with http://drupal.org/node/28996 already)
OS: debian sarge

Things happened when I move forward to log>bad behavior to see logs. It presented me no log, just error messages which I list below.

pg_query(): Query failed: ERROR: relation "bad_behavior_log" does not exist in /usr/share/drupal/includes/database.pgsql.inc on line 45.

query: SELECT COUNT(*) FROM bad_behavior_log w in /usr/share/drupal/includes/database.pgsql.inc on line 62.

pg_query(): Query failed: ERROR: relation "bad_behavior_log" does not exist in /usr/share/drupal/includes/database.pgsql.inc on line 45.

query: SELECT w.* FROM bad_behavior_log w ORDER BY w.date DESC LIMIT 50 OFFSET 0 in /usr/share/drupal/includes/database.pgsql.inc on line 62.

Comments

dpangier’s picture

Assigned: Unassigned » dpangier
Status: Active » Closed (won't fix)

The core Bad Behavior requires mySql (at present). So, this won't be fixable at the module level. The upstream author has been informed of the request.

senpai’s picture

Title: pg_query error when I see the bad_behavior_log » bad_behavior_log MySQL warning
Version: 4.6.x-1.x-dev » 4.7.x-1.x-dev
Status: Closed (won't fix) » Active

I wanted to re-open the O.P.'s post because I am seeing this problem on a newly developed LAMP-driven site. When I go to Administer > Logs > BadBehavior, I see two MySQL warnings. Both of them say that the table bad_behavior_log doesn't exist. I've pasted the two warnings below.

user warning: Table 'XXXX.bad_behavior_log' doesn't exist query: SELECT COUNT(*) FROM bad_behavior_log w in /usr/local/4admin/apache/vhosts/XXXX.com/httpdocs/development/includes/database.mysql.inc on line 120.

user warning: Table 'tourlink.bad_behavior_log' doesn't exist query: SELECT w.* FROM bad_behavior_log w ORDER BY w.date DESC LIMIT 0, 50 in /usr/local/4admin/apache/vhosts/tourlinkconference.com/httpdocs/development/includes/database.mysql.inc on line 120.

I thought about just going into the database and creating these tables by hand, but I'm not sure what their structure or intended purpose might be. I cannot find the snippet of PHP code within Bad Behavior that references these tables, so I suspect it may be a class within Drupal that's doing the heavy lifting.

I'm lost. Help?

senpai’s picture

There's a newer version of bad behavior that I downloaded and installed. I also copied the section of CREATE TABLE out of the .sql file, and ran it manually in my database in order to create the log table. All is well now, I'm happy to say.

senpai’s picture

Status: Active » Fixed

Due to no further discussion or comment from the maintainer, I'm gonna mark this a fixed. If it worked for me, it should work for everyone else too, right? ;=)

Anonymous’s picture

Status: Fixed » Closed (fixed)