GROUP BY queries break on postgres
|Reported by:||pickscrape||Owned by:||martin_s|
Error: Macro ListOfWikiPages(None) failed column "wiki.author" must appear in the GROUP BY clause or be used in an aggregate function
This is because GROUP BY can't guarantee what values you'll get for these other columns unless you group by them too, and of course if you do that, you won't get the uniqueness that you're actually looking for.
I've attached a patch that fixes it by replacing the GROUP BY on a correlated subquery on which fetches the maximum version for the page.
Also, I removed a query which appeared to be completely redundant, since it was being run and then forgotten about as another query was run immediately afterwards.
Hope this helps!