1

With zend2 Currently I use (mysql) But I will change to use postgres

Code:

 <?php
return array(
   'db' => array(
      'driver'         => 'Pdo',
      'dsn'            => 'pgsql:dbname=sample;host=127.0.0.1',
      'driver_options' => array(
         PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES UTF8'
      ),
   ),
   'service_manager' => array(
      'factories' => array(
         'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory'
      ),
   ),

    'module_layouts' => array(
       'Application' => 'layout/layout.phtml',
       'Admin' => 'layout/layout.phtml',
   ),

);

Is there a PostgreSQL equivalent of

 PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")?
tree em
  • 20,379
  • 30
  • 92
  • 130
  • Note that in Postgres, the default charset and collation isn't latin/swedish, but utf8_ci (ci as in case insensitive, if memory serves). So issuing such a command is normally not needed to begin with. – Denis de Bernardy Dec 16 '13 at 11:10
  • http://stackoverflow.com/questions/18250167/how-set-utf-8-in-pdo-class-constructor-for-php-pgsql-database – Benny Hill Dec 16 '13 at 13:40

0 Answers0