System:
------------
PHP 4.4.1
Apache 1.3.34
Drupal CVS-HEAD
Postgresql 8.0.4
Problem:
-------------
When I choose "main pages" in the administration-->registers menu, I get this error:
--------------------------------------------------------------------------------------------
/?q=admin/logs/pages
pg_query(): Query failed: ERROR: column "accesslog.title" must appear in the GROUP BY clause or be used in an aggregate function en la línea 78 del archivo /home/erl/drupal-cvs/includes/database.pgsql.inc.
/?q=admin/logs/pages
query: SELECT COUNT(path) AS hits, path, title, AVG(timer) AS average_time, SUM(timer) AS total_time FROM accesslog GROUP BY path ORDER BY hits DESC LIMIT 30 OFFSET 0 en la línea 95 del archivo /home/erl/drupal-cvs/includes/database.pgsql.inc.
--------------------------------------------------------------------------------------------
This error makes impossible to get these statistics if you are using postgresql as the database. Thanks for your time.
Comment | File | Size | Author |
---|---|---|---|
#1 | drupal-head-statistics-36936_0.diff | 913 bytes | Cvbge |
Comments
Comment #1
Cvbge CreditAttribution: Cvbge commentedHi,
thank you for your report.
As error suggests for postgres some other fields (namely title) need to be added to GROUP BY clause.
Mysql in this case gets a random value for fields that are not in group by - treats them as unique in the group. From http://dev.mysql.com/doc/refman/4.1/en/group-by-hidden-fields.html
Do not use this feature if the columns you omit from the GROUP BY part are not unique in the group! You get unpredictable results.
Attached patch adds the field to the group by clause.
Comment #2
ralfm CreditAttribution: ralfm commentedThanks, I applied this patch and everything works ok now ....... cvs can be updated
Comment #3
Steven CreditAttribution: Steven commentedCommitted to HEAD, thanks.
Comment #4
(not verified) CreditAttribution: commented