"undefined function pg_pconnect()" when connecting to Postgres from CodeIgniter I just installed Postgresql and pgadmin in my Ubuntu system. I can create a database from the pgadmin interface and everything seems ok, but when I try to connect to the database from my CodeIgniter application it cannot not connect. It shows an error like:

An uncaught Exception was encountered


  Type: Error
  
  Message: Call to undefined function pg_pconnect()
  
  Filename: /my codeigniter application
  path/system/database/drivers/postgre/postgre_driver.php


My database configuration is:

$db['postgres_db'] = array(
    'dsn'      =&gt; '', 

    'hostname' =&gt; 'localhost',
    'username' =&gt; 'postgres',
    'password' =&gt; '1234',
    'database' =&gt; 'finance',
    'dbdriver' =&gt; 'postgre',
    'dbprefix' =&gt; '',
    'pconnect' =&gt; TRUE,
    'cache_on' =&gt; FALSE,
    'cachedir' =&gt; '',
    'char_set' =&gt; 'utf8',
    'dbcollat' =&gt; 'utf8_general_ci',
    'swap_pre' =&gt; '',
    'encrypt' =&gt; FALSE,
    'compress' =&gt; FALSE,
    'stricton' =&gt; FALSE,
    'failover' =&gt; array(),
    'save_queries' =&gt; TRUE,
    'port'     =&gt; 5432
);


How can I resolve this problem?
$db['default'] = array(
    'dsn'   =&gt; '',
    'hostname' =&gt; 'pgsql:host=localhost;dbname=Absences_DB',
    'username' =&gt; 'postgres',
    'password' =&gt; 'XXX',
    'database' =&gt; 'Absences_DB',
    'dbdriver' =&gt; 'pdo',
    'dbprefix' =&gt; '',
    'pconnect' =&gt; FALSE,
    'db_debug' =&gt; (ENVIRONMENT !== 'production'),
    'cache_on' =&gt; FALSE,
    'cachedir' =&gt; '',
    'char_set' =&gt; 'utf8',
    'dbcollat' =&gt; 'utf8_general_ci',
    'swap_pre' =&gt; '',
    'encrypt' =&gt; FALSE,
    'compress' =&gt; FALSE,
    'stricton' =&gt; FALSE,
    'failover' =&gt; array(),
    'save_queries' =&gt; TRUE
);


Make sure you have the PDO driver enabled in PHP.