[GENERAL] Create database from template and include comment

Поиск
Список
Период
Сортировка
От Peter Devoy
Тема [GENERAL] Create database from template and include comment
Дата
Msg-id CABoFc_gt+LqTr+wf-yBgfgZ+gT4+d6SmoJRkOJdFK=szt_OY4A@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hi all

If when creating a database I use another user-defined database as a template I would like the option for the comment on the template database to also exist for the new database.  Am I correct in thinking there is no feature for this, perhaps because the global nature of pg_shdescription?

For an example of the default behavior:

CREATE DATABASE test_comment_template;
COMMENT ON DATABASE test_comment_template IS 'hello world';

CREATE DATABASE test_comment WITH TEMPLATE test_comment_template;

SELECT oid, datname, shobj_description(oid, 'pg_database')
FROM   pg_database
WHERE  datname LIKE 'test_comment%';

  oid   |        datname        | shobj_description
--------+-----------------------+-------------------
 828611 | test_comment_template | hello world
 828612 | test_comment          |


DROP DATABASE test_comment;
DROP DATABASE test_comment_template;

Kind regards


Peter

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

Предыдущее
От: Martin Moore
Дата:
Сообщение: Re: [GENERAL] Postgres 9.6 fails to start on VMWare
Следующее
От: Don Seiler
Дата:
Сообщение: Re: [GENERAL] Allow only certain query on replication slave