Re: Unhappy thoughts about pg_dump and objects inherited from template1

Поиск
Список
Период
Сортировка
От Philip Warner
Тема Re: Unhappy thoughts about pg_dump and objects inherited from template1
Дата
Msg-id 3.0.5.32.20001109003321.02db18b0@mail.rhyme.com.au
обсуждение исходный текст
Ответ на Re: Unhappy thoughts about pg_dump and objects inherited from template1  (Jan Wieck <janwieck@Yahoo.com>)
Ответы Re: Unhappy thoughts about pg_dump and objects inherited from template1  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
At 14:04 7/11/00 -0500, Jan Wieck wrote:
>> Thoughts?  At the moment I'm afraid that the functionality we have is
>> worse than the way prior versions behaved --- not least because anyone
>> who was putting user data in template1 has probably gotten used to the
>> prior behavior.  Maybe we should give up the whole idea of user data
>> in template1.
>
>    FWIW,  what  about having another "template0" database, where
>    nobody can add user data. Initially, template0 and  template1
>    are identically.  CREATE DATABASE get's a new switch (used by
>    the pg_dump output) that tells to create it from the  vanilla
>    template0  DB  (generalized, so someone can setup a couple of
>    template<n>'s)  and  all  objects  inherited  from  template1
>    (those not in template0) are regularly dumped per database.

All pg_dump really needs is the abilty to ask for a 'vanilla' database from
'CREATE DATABASE' or createdb. It can use lastsysoid for template1/0 do
dump all database definitions. Any altered system objects will not be
dumped, which is probably OK (and may even be the Right Thing).

The command to create the new database needs to ask for a vanilla database
somehow, but extending the SQL doesn't seem like a good idea. *Maybe* we
can use a new 'set' command to define the template database for the current
session:
   set pg_template <db-name>   create database...

or
   createdb --template=<db-name>

It would also be good to allow some kind of installation-wide default
template (not necessarily template1/0), which is overridden temporarily by
the 'set' command.

If we can do this, then we create template0 & 1 in the same way we create
template1 now, then set template1 as the default template.


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|                                |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/


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

Предыдущее
От: Zeugswetter Andreas SB
Дата:
Сообщение: AW: AW: AW: Issue NOTICE for attempt to raise lock leve l?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Issue NOTICE for attempt to raise lock level?