Re: schema creation during initdb

From: NikhilS <nikkhils(at)gmail(dot)com>
To: "sharath kumar" <k(dot)sharat(at)gmail(dot)com>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: schema creation during initdb
Date: 2007-04-18 10:26:02
Message-ID: d3c4af540704180326v25b3382dx4eff0546359e1592@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 4/18/07, sharath kumar <k(dot)sharat(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aidan Van Dyk 2007-04-18 10:56:17 Re: Hacking on PostgreSQL via GIT
Previous Message Heikki Linnakangas 2007-04-18 10:07:12 Re: schema creation during initdb