Using postgresql as backend in /admin/content/petition yields

* warning: pg_query() [function.pg-query]: Query failed: ERROR: zero-length delimited identifier at or near """" LINE 1: ...FROM petition_signatories WHERE pid = '30' AND comment <> "" ^ in [some path]/includes/database.pgsql.inc on line 139.
* user warning: query: SELECT COUNT(*) AS total FROM petition_signatories WHERE pid = '30' AND comment <> "" in [some path]/sites/all/modules/petition/petition.module on line 776.

Changing line 776 from

$count = db_query('SELECT COUNT(*) AS total FROM {petition_signatories} WHERE pid = \'%s\' AND comment <> ""', $result->nid);

to

$count = db_query('SELECT COUNT(*) AS total FROM {petition_signatories} WHERE pid = \'%s\' AND comment <> \'\'', $result->nid);

Removes the error. Need regression test with mysql.

Comments

gekkoman’s picture

then when you go to trending page:

* warning: pg_query() [function.pg-query]: Query failed: ERROR: function year(timestamp with time zone) does not exist LINE 1: SELECT COUNT(DISTINCT(cid)) AS signups, MAKEDATE(YEAR(NOW())... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. in /var/www/www.illimitable.com/htdocs/food/includes/database.pgsql.inc on line 139.
* user warning: query: SELECT COUNT(DISTINCT(cid)) AS signups, MAKEDATE(YEAR(NOW()), (WEEK(FROM_UNIXTIME(created)) * 7)-6) AS week_starting FROM petition_signatories WHERE pid = 30 GROUP BY week_starting in /var/www/www.illimitable.com/htdocs/food/sites/all/modules/petition/petition.module on line 890.

Obvious psql wasn't considered.

Not worth my effort going through this module as it seems largely inactive - will use an alternative.