Cdbconnection Failed To Open The Db Connection With Pdo_Posgresql

Hi Guys, I have error like this :

CDbConnection failed to open the DB connection: SQLSTATE[IM001]: Driver does not support this function: driver does not support setting attributes




throw new CDbException('CDbConnection.connectionString cannot be empty.');

370             try

371             {

372                 Yii::trace('Opening DB connection','system.db.CDbConnection');

373                 $this->_pdo=$this->createPdoInstance();

374                 $this->initConnection($this->_pdo);

375                 $this->_active=true;

376             }

377             catch(PDOException $e)

378             {

379                 if(YII_DEBUG)

380                 {

381                     throw new CDbException('CDbConnection failed to open the DB connection: '.

382                         $e->getMessage(),(int)$e->getCode(),$e->errorInfo);

383                 }

384                 else

385                 {

386                     Yii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException');

387                     throw new CDbException('CDbConnection failed to open the DB connection.',(int)$e->getCode(),$e->errorInfo);

388                 }

389             }

390         }

391     }



and in config/main like this





                        'emulatePrepare' => true,

			'username' => 'd',

			'password' => 'apatblaja',

			'charset' => 'UTF-8',

			'tablePrefix' => 'tbl_'



help me to fix this…please

What is your connectionString?

Also try to remove the line ‘emulatePrepare’

this is my connectionstring




'connectionString' => 'pgsql:host=localhost;dbname=yiirights',



connectection is fine but when I remove ‘emulatePrepare’ I see error script like this




CDbCommand failed to execute the SQL statement: SQLSTATE[42501]: Insufficient privilege: 7 ERROR: permission denied for relation users. The SQL statement executed was: SELECT id, username, email, createtime, lastvisit, superuser, status, avatar, password, activkey FROM "users" "t" WHERE "t"."email"=:yp0 LIMIT 1 



I am using extension yii user that mean every script use pdo are not working. Should I change all script? or maybe any other solution?

Thanks In Advance

[size=2]“Insufficient privilege / permission denied” - this error message could not be more clear… you need to check your database permissions [/size]:D

oke its work good…thank you so much :D