| Q | A
|------------ | ------
| BC Break | no
| Version | 2.7.1
Commad orm:schema-tool:update run invalid SQLSELECT min_value, increment_by FROM XXX after upgrade from PostgreSQL 9.6 to 10.3.
There is a invalid SQL query for PostgreSQL 10+ at PostgreSqlSchemaManager.php . In PostgreSQL 10+ is a new table for sequences called "pg_sequences" which contains required informations.
Install PostgreSQL 10+ and run command orm:schema-tool:update or simply call method \Doctrine\DBAL\Schema\PostgreSqlSchemaManager::_getPortableSequenceDefinition() with some sequence name.
PostgreSQLSchemaManager should call different SQL query for PostgreSQL 10+.
Working solution is written here https://stackoverflow.com/a/47980943.
Are you sure you are correctly using PostgreSQL 10 platform and not 9.6?
In case of PostgreSQL 10, list of all sequences with their increment_by and min_value is known beforehand so the query should not be executed at all (that code path should be skipped).
Hi Michal, yes i am pretty sure.
~ psql --version
psql (PostgreSQL) 10.3 (Ubuntu 10.3-1)
Here is issue with same bug #2868 which i found approx. 10 minutes before your answer. So this issue is duplicated issue. Sorry for this.
That is version of your PostgreSQL server, but is your DBAL connection using PostgreSQL 10 platform?
Could yould you please dump output of get_class($connection->getDatabasePlatform()) to see what platform is your connection using?
You're right. Platform class is for PostgreSQL 9.4 Doctrine\DBAL\Platforms\PostgreSQL94Platform. Command is OK when i switch to Doctrine\DBAL\Platforms\PostgreSQL100Platform.
Thank you!
That is version of your PostgreSQL server, but is your DBAL connection using PostgreSQL 10 platform?
Could yould you please dump output ofget_class($connection->getDatabasePlatform())to see what platform is your connection using?
Where and how can I dump it?
Most helpful comment
You're right. Platform class is for PostgreSQL 9.4
Doctrine\DBAL\Platforms\PostgreSQL94Platform. Command is OK when i switch toDoctrine\DBAL\Platforms\PostgreSQL100Platform.Thank you!