PostgreSQL Error
s1gg1 - January 9, 2008 - 15:09
| Project: | Article |
| Version: | 5.x-2.4 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
The SQL-Statement to count the articles seems to be wrong.
For every group at the overview-page the following error is printed:
# warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "ON" LINE 1: SELECT t.tid, COUNT( DISTINCT ON (n.nid) n.nid) AS c FROM dr... ^ in /var/www/drupal/includes/database.pgsql.inc on line 125.
# user warning: query: SELECT t.tid, COUNT( DISTINCT ON (n.nid) n.nid) AS c FROM drupalterm_node t INNER JOIN drupalnode n ON t.nid = n.nid WHERE n.status = 1 GROUP BY t.tid in /var/www/drupal/includes/database.pgsql.inc on line 144.
line 125: $last_result = pg_query($active_db,$query)
line 144: trigger_error(...)
thanks.

#1
Which version are you using ?
Can you try to disable the recent articles box ? I guess that's the reason.
I can't promise I'll be able to solve it. Never worked with PostgreSQL before.
#2
Drupal 5.2 and 5.5
PostgreSQL 7.4 and 8.2
Article: Latest Downloadversion
The latest-articles-box shows correctly the latest articles. but by clicking on "more..." the errors occur.
This page shows the following:
Latest Articles
* article 1
* article 2
Article Categories
* cat1 (0)
o subcat1 (0)
o subcat2 (0)
The Number of articles is wrong and the sql-code tries to count it.
SELECT t.tid, COUNT( DISTINCT ON (n.nid) n.nid) ...
#3
I have versions for drupal 4.7 and 5.x and both are the latest. Which version are you using ?
The subcategories part is using taxonomy_term_count_nodes() so no way it can be an article bug.
#4
i am using the version 5.x.
But the listing of the article categories and the count of articles in each categorie is part of the articles-module, isn't it?
thanx.
#5
ok, thank you.
the error is not in the article-module.
it's a bug in the database.psql.inc, as you can see it is already beeing discussed at http://drupal.org/node/128846
#6
Thanks!
Closing this bug. Please reopen if needed.