@@ -60,6 +60,9 @@ Full Default Configuration
6060 driver : pdo_mysql
6161 platform_service : ~
6262
63+ # the version of your database engine
64+ server_version : ~
65+
6366 # when true, queries are logged to a "doctrine" monolog channel
6467 logging : " %kernel.debug%"
6568 profiling : " %kernel.debug%"
@@ -102,6 +105,9 @@ Full Default Configuration
102105 # True to use a pooled server with the oci8 driver
103106 pooled : ~
104107
108+ # the version of your database engine
109+ server_version : ~
110+
105111 # Configuring MultipleActiveResultSets for the pdo_sqlsrv driver
106112 MultipleActiveResultSets : ~
107113
@@ -202,6 +208,7 @@ Full Default Configuration
202208 charset =" UTF8"
203209 logging =" %kernel.debug%"
204210 platform-service =" MyOwnDatabasePlatformService"
211+ server-version =" 5.6"
205212 >
206213 <doctrine : option key =" foo" >bar</doctrine : option >
207214 <doctrine : mapping-type name =" enum" >string</doctrine : mapping-type >
@@ -393,6 +400,7 @@ The following block shows all possible configuration keys:
393400 charset : UTF8
394401 logging : " %kernel.debug%"
395402 platform_service : MyOwnDatabasePlatformService
403+ server_version : 5.6
396404 mapping_types :
397405 enum : string
398406 types :
@@ -428,7 +436,8 @@ The following block shows all possible configuration keys:
428436 wrapper-class =" MyDoctrineDbalConnectionWrapper"
429437 charset =" UTF8"
430438 logging =" %kernel.debug%"
431- platform-service =" MyOwnDatabasePlatformService" >
439+ platform-service =" MyOwnDatabasePlatformService"
440+ server-version =" 5.6" >
432441
433442 <doctrine : option key =" foo" >bar</doctrine : option >
434443 <doctrine : mapping-type name =" enum" >string</doctrine : mapping-type >
@@ -437,6 +446,17 @@ The following block shows all possible configuration keys:
437446 </doctrine : config >
438447 </container >
439448
449+ .. note ::
450+
451+ The ``server_version `` option was added in Doctrine DBAL 2.5, which is used
452+ by DoctrineBundle 1.3 version. The value of this option should match your
453+ database server version (use ``postgres -V `` or ``psql -V `` command to find
454+ your PostgreSQL version and ``mysql -V `` to get your MySQL version).
455+
456+ If you don't define this option and you don't have created your database yet,
457+ you may get ``PDOException `` errors because Doctrine will try to guess the
458+ database server version automatically and none is available.
459+
440460If you want to configure multiple connections in YAML, put them under the
441461``connections `` key and give them a unique name:
442462
@@ -451,11 +471,13 @@ If you want to configure multiple connections in YAML, put them under the
451471 user : root
452472 password : null
453473 host : localhost
474+ server_version : 5.6
454475 customer :
455476 dbname : customer
456477 user : root
457478 password : null
458479 host : localhost
480+ server_version : 5.7
459481
460482 The ``database_connection `` service always refers to the *default * connection,
461483which is the first one defined or the one configured via the
0 commit comments