Hi,

This module didn't work on PostgreSQL. A SQL query was wrong.

Review and port the patch if you like.

Comments

pixture’s picture

I have never used PostgreSQL. I searched the Internet but it seems that PostgreSQL supports both IFNULL and COALESCE. I am wondering why COALESCE does not work. Can you explain what's wrong (end up with an error? or does not work as expected? or what?).

Thanks,

nileshgr’s picture

Actually, in PostgreSQL, its not IFNULL. It was mistyped in the docs. Its NULLIF [1]

COALESCE does the same job.

[1] http://www.postgresql.org/docs/current/interactive/functions-conditional...

nileshgr’s picture

StatusFileSize
new1.26 KB

Hi, I read the patch. The diff arguments got reversed. Here's a clean new working patch.

phaul’s picture

StatusFileSize
new1.75 KB

Also there is an error of missing column from GROUP BY:

query: SELECT MIN(date) AS oldest, MAX(date) AS latest FROM antispam_counter ORDER BY date DESC LIMIT 365 in /var/www/drupal-6.16/sites/all/modules/antispam/antispam.admin.inc on line 456.

pg_query(): Query failed: ERROR: column "antispam_counter.date" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: ...AX(date) AS latest FROM antispam_counter ORDER BY date DESC ... ^ in /var/www/drupal-6.16/includes/database.pgsql.inc on line 139.

this patch remedies that as well.

nileshgr’s picture

Yeah, I was thinking of submitting a patch for the same.

Everett Zufelt’s picture

Status: Needs review » Closed (won't fix)

Please re-open if the problem exists with 7.x-1.x

liam morland’s picture

Issue tags: +PostgreSQL