valle122 June 04, 2015 / 00:00
Installing in server with Debian 6 and PostgreSQL 9.1 doesn't  complete.

1. When the database already exists the installation stops without error message.

2.  After database creation, it occurs SQL error (42803 - grouping_eror). The message don't appear in the page, but I get it through Firebug.

[2015-06-04 04:36:48] production.ERROR: exception 'PDOException' with message 'SQLSTATE[42803]: Grouping error: 7 ERROR:  column "mw__modules.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: select "mw__modules".* from "mw__modules" where ("module" = ...
               ^' in /var/www/projects/dev/Microweber/vendor/laravel/framework/src/Illuminate/Database/Connection.php:290
Stack trace:
#0 /var/www/projects/dev/Microweber/vendor/laravel/framework/src/Illuminate/Database/Connection.php(290): PDOStatement->execute(Array)
#1 /var/www/projects/dev/Microweber/vendor/laravel/framework/src/Illuminate/Database/Connection.php(612): Illuminate\Database\Connection->Illuminate\Database\{closure}(Object(Illuminate\Database\PostgresConnection), 'select "mw__mod...', Array)
#2 /var/www/projects/dev/Microweber/vendor/laravel/framework/src/Illuminate/Database/Connection.php(576): Illuminate\Database\Connection->runQueryCallback('select "mw__mod...', Array, Object(Closure))
#3 /var/www/projects/dev/Microweber/vendor/laravel/framework/src/Illuminate/Database/Connection.php(293): Illuminate\Database\Connection->run('select "mw__mod...', Array, Object(Closure))
#4 /var/www/projects/dev/Microweber/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1377): Illuminate\Database\Connection->select('select "mw__mod...', Array, true)
#5 /var/www/projects/dev/Microweber/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1367): Illuminate\Database\Query\Builder->runSelect()
#6 /var/www/projects/dev/Microweber/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1354): Illuminate\Database\Query\Builder->getFresh(Array)
#7 /var/www/projects/dev/Microweber/src/Microweber/Providers/DatabaseManager.php(260): Illuminate\Database\Query\Builder->get()
#8 /var/www/projects/dev/Microweber/src/Microweber/Providers/CacheStore.php(174): Microweber\Providers\DatabaseManager->Microweber\Providers\{closure}()
#9 /var/www/projects/dev/Microweber/src/Microweber/Providers/DatabaseManager.php(261): Microweber\Providers\CacheStore->remember('modules39269807...', 60, Object(Closure))
...

This is a typical error with PostgreSQL, that follows the SQL standart. MySQL and SQLite behavior is less restricted.

"The problem is, that in PostgreSQL you need to add all the columns you want to have in your select to your group by. so your statement should be like  SELECT * FROM table GROUP BY column1, column2..." (http://stackoverflow.com/questions/16012818/postgresql-grouping-error)

" this is a common aggregation problem. Before SQL3 (1999), the selected fields must appear in the GROUP BY clause." (http://stackoverflow.com/questions/19601948/must-appear-in-the-group-by-clause-or-be-used-in-an-aggregate-function)

Please, I don't find the source of SQL to fix it.

References
- http://www.postgresql.org/docs/9.4/static/errcodes-appendix.html (42803 - grouping error)
- http://stackoverflow.com/questions/16012818/postgresql-grouping-error
- http://stackoverflow.com/questions/18061285/postgresql-must-appear-in-the-group-by-clause-or-be-used-in-an-aggregate-functi




No comments

You have to log in or register to post a comment: