
has_filter :categorized with PostgreSQL
Reported by Joseph Ridgway | September 18th, 2009 @ 05:16 PM
Filtering articles (or albums etc) by category doesn't work with PostgreSQL installed. PostgreSQL doesn't allow "#{table_name}.id" in the group by clause like MySQL does. Rather, each column must be listed. I've tried fixing this but didn't get far. If I understood the method better I might get further. Any help?
This can be found in vendor/adva/engines/adva_cms/vendor/plugins/has_filter/lib/has_filter/active_record/act_macro.rb.
Error below:
PGError: ERROR: column "contents.site_id" must appear in the
GROUP BY clause or be used in an aggregate function
LINE 1: SELECT contents., COUNT() AS count FROM "contents"
INNER...
^
: SELECT contents., COUNT() AS count FROM "contents" INNER JOIN "categorizations" ON "categorizations".categorizable_id = "contents".id AND "categorizations".categorizable_type = E'Content' INNER JOIN "categories" ON "categories".id = "categorizations".category_id WHERE (((categories.id IN(E'4')) AND ("contents".section_id = 1)) AND ("contents".section_id = 1)) AND ( ("contents"."type" = 'Article' ) ) GROUP BY contents.id HAVING count(*) >= 1 ORDER BY contents.position, contents.id DESC, contents.published_at DESC LIMIT 25 OFFSET 0
Comments and changes to this ticket
-
Marko Seppä November 23rd, 2009 @ 11:36 AM
- Tag set to filtering, postgresql
- State changed from new to open
Hi Joseph,
we are aware that there are still many known problems with PostgreSQL and adva-cms, any contributions are welcome. :)
Thanks for the report,
-- Marko
-
AshleyMcCall May 18th, 2022 @ 08:45 AM
The sharing SQL information is quite wise and updates would be recommended. I hope after the help here the people will be able to fix the problem with their SQL server. Do share more such suggestions on https://collegecures.com/2022/pros-and-cons-of-using-essay-writing-... hope these are beneficial and supportive for everyone.
-
-
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<p>Cutting edge cms, blog, wiki, forum ... plattform.</p>
<p>Find the code on <a href="http://github.com/svenfuchs/adva_cms/tree/master">GitHub: adva cms</a></p>
<p>Part of the business application framework <a href="http://www.advabest.org/">adva best</a>.</p>