Default schema for Postgresql

2 messages Options
Embed this post
Permalink
Mark Hage

Default schema for Postgresql

Reply Threaded More More options
Print post
Permalink
Hi,

I'm writing some re-usable modules, which use a postgresql database (through pdo).
Is it possible to set the schema in some parameter, so I don't have to change all the DbTable classes when I transport my code?

I tried it in the ini file like:
resources.db.adapter = PDO_PGSQL
resources.db.params.host = localhost
resources.db.params.username = user
resources.db.params.password = pass
resources.db.params.dbname = defaultdb
resources.db.params.schema = myschema

But that doesn't seem to work.
Should this be possible or are there any other possiblities?

Thanks,
Mark

Mark Wright

Re: Default schema for Postgresql

Reply Threaded More More options
Print post
Permalink
Perhaps it could be a driver option? One thing you could do is create
an abstract table class that sets the schema to public or whatever.
Then if you need to change the schema later you just need to change it
in that one file.



Mark

On Mon, Oct 12, 2009 at 9:48 AM, Mark Hage <[hidden email]> wrote:

> Hi,
>
> I'm writing some re-usable modules, which use a postgresql database (through
> pdo).
> Is it possible to set the schema in some parameter, so I don't have to
> change all the DbTable classes when I transport my code?
>
> I tried it in the ini file like:
> resources.db.adapter = PDO_PGSQL
> resources.db.params.host = localhost
> resources.db.params.username = user
> resources.db.params.password = pass
> resources.db.params.dbname = defaultdb
> resources.db.params.schema = myschema
>
> But that doesn't seem to work.
> Should this be possible or are there any other possiblities?
>
> Thanks,
> Mark
>
>



--
Have fun or die trying - but try not to actually die.