Hi,

I was wondering if there is any chance of this module being compatable with postgres.

currently I get errors when i try and run it on my site which uses postgres instead of mysql

see an attached screenshots for the error messages.

Thanks

bfo

CommentFileSizeAuthor
#4 522260_float.patch1.04 KBanarcat
screenshot.JPG154.31 KBbfo
decision_selection.JPG210.41 KBbfo

Comments

anarcat’s picture

Title: Does not work with postgres » Port to PostgreSQL
Category: bug » feature
Status: Active » Postponed (maintainer needs more info)

from what I can tell by the screenshots, the find_in_set() function is not available in postgres. Any idea of what the replacement could be? The first screenshot seems to say that the decisions table doesn't exist at all, do you get errors when installing the module?

bfo’s picture

Hi,

yes you get an error when you try and enable decisions please see message below

warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "(" at character 147 in /mounts/max30/home/ukra/newsite/www/includes/database.pgsql.inc on line 139.
user warning: query: CREATE TABLE decisions ( nid int NOT NULL, mode varchar(32) NOT NULL, quorum_abs int_unsigned NOT NULL default 0, quorum_percent real_unsigned(32) NOT NULL default '0', uselist smallint default 0, active smallint default 1, runtime int NOT NULL default 0, maxchoices int_unsigned NOT NULL default 0, algorithm varchar(100), showvotes smallint, startdate int_unsigned, PRIMARY KEY (nid) ) in /mounts/max30/home/ukra/newsite/www/includes/database.inc on line 517.

I'll speak to my other half who has helped me in the past by editing modules so they work for me on postgres to see if he has any ideas.

Thanks

bfo’s picture

Status: Postponed (maintainer needs more info) » Active
anarcat’s picture

Status: Active » Needs review
StatusFileSize
new1.04 KB

Could you try out the attached patch? I don't have a pgsql server handy right now...

anarcat’s picture

Status: Needs review » Needs work

Note that I introduced a MySQL-specific query in http://drupal.org/cvs?commit=253542. I would like to know how this could be done in PostgreSQL. Specifically, I'm looking for the postgres equivalent of GROUP_CONCAT().

anarcat’s picture

Apparently, what I need can be done with arrays: http://mssql-to-postgresql.blogspot.com/2007/12/cool-groupconcat.html or http://devtime.blogspot.com/2007/04/porting-mysql-groupconcat-to-postgre...

select *, array_to_string(array(select col2 from t2 where t1_id=t1.t1_id),',') from t1;

Now not sure how we make a different query depending on the database backend? Could someone come up with a complete request replacement? I can surely figure out how to give the right request to the backend...

sebzur’s picture

Subscribing..

liam morland’s picture

Component: Code » Code - Base Decisions module
Issue tags: +PostgreSQL