From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Jim Mercer <jim(at)reptiles(dot)org> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: template1, can there be a template2/3/4? |
Date: | 2001-06-04 16:13:23 |
Message-ID: | 6241.991671203@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Jim Mercer <jim(at)reptiles(dot)org> writes:
> would it be possible for me to create a template2 and have some arbitrary
> database use it instead of template1?
In 7.1, you can tell CREATE DATABASE to clone any existing database,
not only template1. However, this doesn't seem to have much to do with
what you are really after.
> this way "sample" could have its own set of users, permissions, etc, etc.
Users (also groups) are installation-wide, so there's no way to have
database-specific users. AFAICS, the only thing the alternate-template
facility is good for is to preinstall languages, tables, etc into some
databases and not others.
> 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
Which database you are connected to has nothing whatever to do with
whether you can see/manipulate other databases. template1 is certainly
not special in that regard. The only reason createdb and friends
connect to template1 is that it's the only DB name they can be pretty
certain exists.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Jim Mercer | 2001-06-04 16:20:10 | Re: template1, can there be a template2/3/4? |
Previous Message | Lee Kwok Shing | 2001-06-04 16:08:18 | Re: upgrading a database with large objects |