Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: column "user_stats_ips.first_seen_timestamp" must appear in the GROUP BY clause or be used in an aggregate function in /home/forum/drupal-6.10/includes/database.pgsql.inc on line 139.
* user warning: query: SELECT MAX(ip_address) FROM user_stats_ips WHERE uid = 1 ORDER BY first_seen_timestamp in /home/forum/drupal-6.10/sites/all/modules/user_stats/user_stats.module on line 98.
Comments
Comment #1
grub3 CreditAttribution: grub3 commentedWhat does MAX(ip_address) address for?
No? In fact, I don't understand the meaning of this SQL query.
Could you explain what it does ?
In user_stats.module, this is this line:
I think the SQL command **could be*** wrong in both MySQL and PostgreSQL.
The SQL command is trying to select the fist row. This should be:
Comment #2
grub3 CreditAttribution: grub3 commentedStatus patch reviewed by the community.
Comment #3
grub3 CreditAttribution: grub3 commentedThe original query may be wrong, we are not trying to select the maximum value of an IP, but the first row.
Comment #4
jaydub CreditAttribution: jaydub commentedI ran into this as well. The GROUP BY problem is typical in PostgreSQL since MySQL conveniently ignores what is normally bad logic when GROUP BYs are involved.
I too however was wondering what the rationale for the MAX(ip_address) call was. It seems to me that the desired behavior is to return the most recently used IP address which as others above have pointed out can be done with an ORDER BY and LIMIT.
Comment #5
wa2nlinux CreditAttribution: wa2nlinux commentedOk it seem to be work :D, I'll report if anything goes wrong
Comment #6
Liam McDermott CreditAttribution: Liam McDermott commentedFixed. Thanks. :)
Comment #7
wa2nlinux CreditAttribution: wa2nlinux commentedWait ... seem still error on it
Comment #8
wa2nlinux CreditAttribution: wa2nlinux commentedError was gone using dev version