Re: template1, can there be a template2/3/4?

From: will trillich <will(at)serensoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: template1, can there be a template2/3/4?
Date: 2001-06-07 00:27:30
Message-ID: 20010606192730.B4612@serensoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jun 04, 2001 at 11:16:40AM -0400, Jim Mercer wrote:
> would it be possible for me to create a template2 and have some arbitrary
> database use it instead of template1?
>
> the reason i ask this is that it would be useful to have something to the
> effect of:
>
> database access startup for "sample" database.
>
> if exists sample_cat database, use it instead of template1
> otherwise use template1
>
> this way "sample" could have its own set of users, permissions, etc, etc.
>
> it would be a method for getting around the fact that a user in template1
> has access to all of the other databases, modulo per-database permissions
> via GRANT/REVOKE
>
> does this make any sense?

as has already been discussed, template1 is basically the
default template to copy when creating a new database.

as for which relations are system-wide (versus
database-specific) check for files in
/var/lib/postgres/data/pg_*:

pg_control
pg_database
pg_geqo
pg_group
pg_group_name_index
pg_group_sysid_index
pg_hba.conf
pg_ident.conf
pg_log
pg_pwd
pg_pwd.reload
pg_shadow
pg_variable

(note that some of those are conf files, not db relations...)

all the other 'system' tables ARE database-specific
and thus reside in their respective subdirectories at
/var/lib/postgres/data/base/<databasename>/pg_*

--
#95: We are waking up and linking to each other. We are watching. But
we are not waiting. -- www.cluetrain.com

will(at)serensoft(dot)com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lee Harr 2001-06-07 00:45:12 Re: Default value for bit datatype
Previous Message will trillich 2001-06-07 00:18:22 Re: Re: Updating views