Re: Unhappy thoughts about pg_dump and objects inherited from template1

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Unhappy thoughts about pg_dump and objects inherited from template1
Дата
Msg-id 26709.973698983@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Unhappy thoughts about pg_dump and objects inherited from template1  (Philip Warner <pjw@rhyme.com.au>)
Ответы Re: Unhappy thoughts about pg_dump and objects inherited from template1  (Philip Warner <pjw@rhyme.com.au>)
Список pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> Just seems like we'd be forcing non-standard syntax on ourselves when/if
> CREATE DATABASE becomes CREATE SCHEMA; I would assume that the two
> statements would become synonymous?

No, I don't think so --- we already have WITH LOCATION and WITH
ENCODING, neither of which look like schema-level properties to me.

> [Minor aside: would 'FROM TEMPLATE' be better?]

WITH is already embedded in the CREATE DATABASE syntax.

> Question: if I issue a "CREATE DATABASE foo WITH TEMPLATE 'my-favorite-db'"
> will I just get a copy of the specified database, including data?

If we allow it, that's what would happen.  Seems like a potential
security hole though ... should we restrict the set of clonable
templates somehow?

It occurs to me that the current implementation of CREATE DATABASE
assumes that no changes are actively going on in the cloned database;
for example, you'd miss copying any pages that are sitting in dirty
buffers in shared memory.  So trying to copy an active database this
way is a recipe for trouble.  Probably better restrict it to identified
template databases.  Maybe only allow cloning from DBs that are named
templateNNN?
        regards, tom lane


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

Предыдущее
От: Philip Warner
Дата:
Сообщение: Re: Unhappy thoughts about pg_dump and objects inherited from template1
Следующее
От: Philip Warner
Дата:
Сообщение: Re: Unhappy thoughts about pg_dump and objects inherited from template1