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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: template1, can there be a template2/3/4?
Дата
Msg-id 6241.991671203@sss.pgh.pa.us
обсуждение исходный текст
Ответ на template1, can there be a template2/3/4?  (Jim Mercer <jim@reptiles.org>)
Ответы Re: template1, can there be a template2/3/4?  (Jim Mercer <jim@reptiles.org>)
Список pgsql-general
Jim Mercer <jim@reptiles.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Martín Marqués
Дата:
Сообщение: Re: datestyle
Следующее
От: Jim Mercer
Дата:
Сообщение: Re: template1, can there be a template2/3/4?