Closed (fixed)
Project:
Counter
Version:
6.x-2.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Oct 2009 at 10:42 UTC
Updated:
15 May 2010 at 01:47 UTC
Jump to comment: Most recent file
I am getting this one:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: operator does not exist: character varying + integer LINE 1: ...ATE counter_data SET counter_value = counter_value+1 WHERE c... ^ HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts. in /home/private/mysite/home/mysite/htdocs/includes/database.pgsql.inc on line 139.
* user warning: ERROR: operator does not exist: character varying + integer LINE 1: ...ATE counter_data SET counter_value = counter_value+1 WHERE c... ^ HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts. query: UPDATE counter_data SET counter_value = counter_value+1 WHERE counter_name='site_counter' in /home/private/mysite/home/mysite/htdocs/sites/all/modules/counter/counter.module on line 168.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | counter_install.zip | 1.19 KB | cornelia |
Comments
Comment #1
knee commentedA quick solution is to change line 167
from
$sql = " UPDATE {counter_data} SET counter_value = counter_value+1 WHERE counter_name='site_counter'";
to
$sql = " UPDATE {counter_data} SET counter_value = counter_value::int+1 WHERE counter_name='site_counter'";
Not the best solution but it does it's work..
Comment #2
janeks commentedThank's!
It works now!
brgds
Janeks
Comment #3
dm_mash commentedAs counter_value is of varchar type then I guess lines 167-168:
should be changed to something like
And this is how it looks like in similar UPDATEs later in the code.
BTW what does exactly "Site Counter" value mean? It seems unclear to me.
Comment #4
cornelia commentedI think counter_value should be defined as integer in the database table.
Attached my install script which works well with PostgreSQL 8.4.
Greetings
Conni
Comment #5
drupalnesia commentedFixed. Thanks all for patching and review.
6.x-2.4: Bug fix: PostgreSQL can not accept "counter_data.counter_value + 1" since it is varchar
Comment #6
drupalnesia commentedResolved!
Comment #7
dm_mash commentedIt results in errors like
query: INSERT IGNORE INTO counter (counter_ip,counter_date,counter_page) VALUES ('192.168.0.1','2010-04-14 14:15:14','/admin/settings/date-time') in /home/www/sites/all/modules/counter/counter.module on line 177.So 'IGNORE' should appear only in mysql/mysqli case.
Comment #8
drupalnesia commentedPlease don't change the TITLE. The integer issue has been fixed in 6.x-2.4.
6.x-2.4: Bug fix: PostgreSQL can not accept "counter_data.counter_value + 1" since it is varchar
For IGNORE clause problem in PostgreSQL follow this thread http://drupal.org/node/782088