Re: schema creation during initdb - Mailing list pgsql-hackers

From NikhilS
Subject Re: schema creation during initdb
Date
Msg-id d3c4af540704180326v25b3382dx4eff0546359e1592@mail.gmail.com
Whole thread Raw
In response to Re: schema creation during initdb  ("sharath kumar" <k.sharat@gmail.com>)
Responses Re: schema creation during initdb  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Hi,

On 4/18/07, sharath kumar <k.sharat@gmail.com> wrote:
Sorry i have put the question wrongly. I wanted to ask if we can create a schema during createdb time so that i have to hide the following from the user.
 psql -c 'create schema foo' mytemplate
 psql -c 'create table foo.bar ...' mytemplate
Whenever a user runs createdb command, the above schema and table should be created automatically.
Thanks,
Sharat.

One way that I can think of doing this would be by adding the details about the new schema and the tables that lie therein in the src/backend/catalog/information_schema.sql file (I dont know if this is the recommended way though). These will end up becoming a part of template1 and any subsequent databases that are created will contain them.

Regards,
Nikhils

--
EnterpriseDB               http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: schema creation during initdb
Next
From: Aidan Van Dyk
Date:
Subject: Re: Hacking on PostgreSQL via GIT