Hi,

I installed the module on my drupal 5.3 installation, running on WIndows IIS with PostgreSQL 8.5. I can use node_style successfully, creating and applying schemes works like expected. However, while trying to list the existing schemes I'm getting the following error (which makes it hard to organize the schemes):

Referer: http://myhost.com/admin/build/node_style
Message: query: SELECT s.name, s.sid, COUNT(m.sid) AS count FROM node_style_schemes s LEFT JOIN node_style_maps m USING (sid) GROUP BY s.sid ORDER BY s.name in D:\my\path\includes\database.pgsql.inc in line 144.

* warning: pg_query() [function.pg-query]: Query failed: ERROR: column "s.name" must appear in the GROUP BY clause or be used in an aggregate function in D:\my\path\includes\database.pgsql.inc on line 125.

CommentFileSizeAuthor
#2 node_style.module.diff363 bytesdeining

Comments

Zen’s picture

If you are comfortable with editing some code, can you please try reordering the SELECT variable list in the query so that s.sid is listed first? I think that should do the trick. I don't have a pgSQL install to test this on, sorry.

Thanks Andreas.
-K

deining’s picture

StatusFileSize
new363 bytes

No, that didn't do the trick.
However, it looks like others encountered this error, too: http://drupal.org/node/92809
So I simply added s.name to the GROUP BY clause of the query:
SELECT s.name, s.sid, COUNT(m.sid) AS count FROM node_style_schemes s LEFT JOIN node_style_maps m USING (sid) GROUP BY s.sid,s.name ORDER BY s.name
I created a patch file which you find attached. With that patch applied, node_style is running smoothly on PostgreSQL now.

Zen’s picture

Version: 5.x-2.1 » 6.x-1.x-dev

Fixed in 6-dev. Thanks for the patch.

Zen’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.