I'm using several bits and pieces for my email server that use postgresql for storage. I really don't want several different databases, though. If I put them all in the same database, there is a slight -- as in no -- chance of a name collision for table names, etc.
I just spent an hour looking at the code for the grey listing daemon to see what it would take to have it use a specific schema in the email database. Turns out that it is very simple for any code that links to libpg. The connection string (conninfo) can include parameters such as "search_path." I could add a search_path configuration option to that code very easily. Great.
But one of the bits -- the second biggest bit -- uses a third party library that knows how to talk to several different databases. Suddenly it is hard to tell that bit to use a schema. Foiled again in my great plan.
Postgresql to the rescue. The default search_path is "$USER",public. Ah-ha! If each bit and piece connects with its own username, I can have a schema for each bit by naming the schema after the bit or piece. Simple. And it is what I shall do.
In any event, if a program is written as a adjunct to other programs and it only talks to postgresql, it should damn well offer up some options about how to talk to the database! It is not that hard.
I just spent an hour looking at the code for the grey listing daemon to see what it would take to have it use a specific schema in the email database. Turns out that it is very simple for any code that links to libpg. The connection string (conninfo) can include parameters such as "search_path." I could add a search_path configuration option to that code very easily. Great.
But one of the bits -- the second biggest bit -- uses a third party library that knows how to talk to several different databases. Suddenly it is hard to tell that bit to use a schema. Foiled again in my great plan.
Postgresql to the rescue. The default search_path is "$USER",public. Ah-ha! If each bit and piece connects with its own username, I can have a schema for each bit by naming the schema after the bit or piece. Simple. And it is what I shall do.
In any event, if a program is written as a adjunct to other programs and it only talks to postgresql, it should damn well offer up some options about how to talk to the database! It is not that hard.
Tags: