Search Postgresql Archives

Create database from template and include comment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux