* Installing Counter module
* The configuration options have been saved.

* warning: pg_query() [function.pg-query]: Query failed: ERROR: column "nid" does not exist in /var/www/drupal6/includes/database.pgsql.inc on line 138.
* user warning: query: CREATE TABLE counter ( counter_id serial CHECK (nid >= 0), counter_ip varchar(32) NOT NULL default '', counter_date varchar(32) NOT NULL default '', counter_page varchar(32) NOT NULL default '0', PRIMARY KEY (counter_id) ) in /var/www/drupal6/sites/all/modules/counter/counter.install on line 26.

FYI, I am using Drupal 6.4, on Debian Etch with PostgreSQL as the dbms.

Comments

jasontan’s picture

This is what happened when I added the counter module to Blocks.

* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "counter" does not exist in /var/www/drupal6/includes/database.pgsql.inc on line 138.
* user warning: query: SELECT count(*) AS total FROM counter WHERE counter_ip='116.206.34.22' AND counter_date='2008-08-23' AND counter_page='admin,build,block' in /var/www/drupal6/sites/all/modules/counter/counter.module on line 239.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "IGNORE" at character 9 in /var/www/drupal6/includes/database.pgsql.inc on line 138.
* user warning: query: INSERT IGNORE INTO counter (counter_ip, counter_date, counter_page) VALUES ('116.206.34.22', '2008-08-23', 'admin,build,block') in /var/www/drupal6/sites/all/modules/counter/counter.module on line 248.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "counter" does not exist in /var/www/drupal6/includes/database.pgsql.inc on line 138.
* user warning: query: SELECT count(*) as total FROM counter c in /var/www/drupal6/sites/all/modules/counter/counter.module on line 254.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "counter" does not exist in /var/www/drupal6/includes/database.pgsql.inc on line 138.
* user warning: query: SELECT count(*) as total FROM (SELECT counter_ip FROM counter GROUP BY counter_ip) c in /var/www/drupal6/sites/all/modules/counter/counter.module on line 262.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "counter" does not exist in /var/www/drupal6/includes/database.pgsql.inc on line 138.
* user warning: query: SELECT counter_date FROM counter order by counter_date ASC LIMIT 1 in /var/www/drupal6/sites/all/modules/counter/counter.module on line 306.

drupalnesia’s picture

Status: Active » Closed (fixed)

Counter 6.x-1.4 has used Drupal 6 new Database schema. Now, all database supported by Drupal automatically works, thanks to new D6 database schema!
Enjoy Counter 6.x-1.4

janeks’s picture

I got similar error when installing Counter module 6.x-1.8 on Drupal 6.12:

    * warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "IGNORE" LINE 1: INSERT IGNORE INTO counter (counter_ip, counter_date, cou... ^ in /htdocs/includes/database.pgsql.inc on line 139.
    * user warning: query: INSERT IGNORE INTO counter (counter_ip, counter_date, counter_page) VALUES ('*.*.*.*', '2009-06-13', 'admin,settings,counter') in /htdocs/sites/all/modules/counter/counter.module on line 121.

What could be done to solve this?

drupalnesia’s picture

Version: 6.x-1.2 » 6.x-1.9

@janeks:

I have try to fix this incompatible issue with PostgreSQL but I have no PostgreSQL installed.
Fixing has applied to Counter 6.x-1.9, so please make a try and report your result here.

Thanks for reporting bug.

janeks’s picture

Thanks!

Now it works!

brgds
Janeks