Forum OpenACS Q&A: Change template1 in PG for new datamodel
We have a production database openacs 3 running on postgresql 7.1.2. Now we want to add a second database. When I use the command:
It creates a new database from template1. NOT what I want. I want to create a new blank database and use the 3.2.5 datamodel. Template1 has the old model with modifications I don't want.
QUESTION: How do I make a blank database on an already running pg installation so I can load a different datamodel.
The answer may be useful later when I want to try out the OpenAcs 4 series although I may need a newer version of PG for this.
Later versions (7.2 I think) add a template0 that is a bare empty database and also add the ability to define different databases as templates. So you could install the basic OpenACS data model into a database called something like "OpenACS_Template" and create a new openacs db with a command similar to "create database my_openacs_site with template='OpenACS_Template'"
-T, --template template
Specifies the template database from which to build this database.
Thanks David and Roberto,
My man page for createdb does not show the --template command, yet
it WORKS.... Must have been a new feature in pg 7.1.2.
The command used:
createdb --template template0 mydb2