I am trying to switch from MySql to Postgresql 9.1. I just found out that caching is not working with Postgresql. I wonder is it only with 9.1, or maybe my configuration is wrong?
This is my test code:
$key= 'test1';
$value = Yii::app()->cache->get($key);
$cached = 'From cache';
if($value === false)
{
$cached = 'Not from cache ';
$value = 'some data';
Yii::app()->cache->set($key, $value, 5);
}
echo "$cached $value";
With Postgresql it allways echoes ‘Not from cache some data’
My configuration for Postgresql:
'cache'=>array(
'class'=>'system.caching.CDbCache',
'autoCreateCacheTable' => true,
'cacheTableName' => 'kes_tabela',
'connectionID' => 'db',
),
'db'=>array(
'connectionString' => 'pgsql:host=localhost;port=5432;dbname=biblioteka2',
'emulatePrepare' => true,
'username' => 'postgres',
'password' => 'mypassword',
'charset' => 'utf8',
'schemaCachingDuration' => 60,
'enableProfiling' => true,
),
I can write and read database, everything else is working, except caching.