Using the Member module with PostgreSQL I get the following error:

warning: PostgreSQL query failed:  ERROR:  Function 'concat(unknown, varchar, unknown)' does not exist
	Unable to identify a function that satisfies the given argument types
	You may need to add explicit typecasts
 in /usr/share/pear/DB/pgsql.php on line 173.

user error: DB Error: unknown error
query: SELECT u.uid, u.name, r.name AS role, u.mail, u.homepage, u.data FROM users u LEFT JOIN role r ON u.rid = r.rid WHERE 'authenticated user' LIKE CONCAT('%', r.name, '%') AND status = 1 ORDER BY r.name, u.name in /home/jaa/public_html/Drupal/drupal-4.2.0/includes/database.pear.inc on line 74.

Comments

Chris Johnson’s picture

PostreSQL uses the SQL92 standard concatenation operator || instead of the MySQL-specific concat() function.

I'm not sure what the best way to solve this is. Most people do not run their MySQL installations in ANSI mode.

In normal mode, MySQL makes || a synonym for OR. In ANSI mode, || becomes the concatenation operator.

teamonkey’s picture

How about getting rid of it entirely:
WHERE 'authenticated user'=r.name

I know that this means relying on the administrator to enter the exact role in the admin pages, but that could quite easily be replaced by a multiple select box.

Chris Johnson’s picture

Not only is CONCAT() non-standard, but the code as written in members.module had bugs that prevented it from working when more than one role was listed. See the drupal devel list for a patch which fixes this and uses teamonkey's suggestion for a list box to eliminate the CONCAT(). The patch should work with all databases.

(I was unable to post the patch to the bug report -- I kept getting a message about the request being terminated for suspicious input. What's up with that?)

..chris

matt westgate’s picture

I committed this patch to cvs.

adrian’s picture

Assigned: Unassigned » vertice@www.drop.org

Working on postgres compat

adrian’s picture

Project: » Members
Component: modules » Code

this has been fixed for a while now.

Anonymous’s picture

Automatically closed due to inactivity (marked fixed for 14 days).