I'm testing Yii to see it's benefits. I like yii a lot but when it comes to Postgresql connections I have some problems.
My db model uses different schemas for holding different data, but when I tried to inherit PgSqlSchema I noticed that schema was a constant 'DEFAULT_SCHEMA'. Is there any way to use Postgresql schemas extending PgsqlSchema class without lot of function rewriting? I need to do something like "SET search_path 'schema1,schema2,schema3'"
So your sequence relies on search_path? You can extend CDbConnection and override its init() method. In the method, after calling the parent's init(), you can execute this command to set the search_path.
In your app config, when you configure 'db', you need to specify its 'class' option to point to your new DB connection class.
Im sorry for digging out an old topic, but i have problem similar to its autor one. How can i set schema to work with? I have my db in other than ‘public’ schema, and i couldnt find where to set it. For my purpose i had to set DEFAULT_SCHEMA in CPgsqlSchema to be my schema. How to do it proper way?
changing DEFAULT_SCHEMAdid nothing, cause selects still use public schema