[Mediawiki-l] Solving the GROUP BY problem

Tim Starling tstarling at wikimedia.org
Wed Apr 27 23:26:33 UTC 2011

On 28/04/11 00:15, Greg Sabino Mullane wrote:
> 1) Manually add in all the columns from the user table to the 
> GROUP BY. Painful, and subject to immediate breakage when a 
> column is added or removed from the user table.

You could add a static function to User which provides the field name
array. If it were used in User::loadFromDatabase(), then it would be
immune to bit rot.

Can you add a note about this to docs/database.txt and
docs/databases/postgres.txt? Something explaining why we can't use *
with group by.

-- Tim Starling

More information about the MediaWiki-l mailing list