Closed (duplicate)
Project:
Drupal core
Version:
6.x-dev
Component:
statistics.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Jun 2007 at 08:49 UTC
Updated:
16 Aug 2009 at 10:23 UTC
The result on this page make use of MySQL specific "concat" function and hence fails with PostgresSQL with following error:
warning: pg_query() [function.pg-query]: Query failed: ERROR: function concat(int_unsigned, character varying) does not exist LINE 1: SELECT COUNT(DISTINCT(CONCAT(uid, hostname))) FROM accesslog ^ HINT: No function matches the given name and argument types. You may need to add explicit type casts. in MyPath\D6\includes\database.pgsql.inc on line 155.
Comments
Comment #1
seanrDon't know pgsql very well, but what happens if you do it like this?
SELECT COUNT(DISTINCT(uid || hostname AS hit))) FROM accesslogObviously that won;t work in mysql, so it'd have to be abstracted out somehow.
Comment #2
vivek.puri commentedI didn't wanted to change code but I managed to find a work around by adding a function as:
Comment #3
wolfie commentedThe function suggested by crystalcube has been added to HEAD. This report can/should be closed now.
Comment #4
chx commentedComment #5
(not verified) commentedComment #6
sirprize commentedProblem occurs again with postgres 8.3: The concat function ist not created because int_unsigned seems to no longer exist. With
(int_unsigned replaced by integer) it works again.
Comment #7
lukeprentice commentedcreating that function in my postgres 8.3.4 worked, but that shouldn't be necessary for drupal. i'd suggest not using mysql-specific SQL syntax. always check with other RDBMs.
Comment #8
dave reidDuplicate of #229051: Top Visitor Page problem with PostgreSQL 8.3. Should backport when fixed.