diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-07-01 20:10:38 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-07-01 20:10:38 -0400 |
commit | fbb1d7d73f8e23a3a61e702629c53cef48cb0918 (patch) | |
tree | b0f1f20d6dc19568f0916cc33e3aeb7caa263f89 /doc/src | |
parent | 15c82efd6994affd1d5654d13bc8911a9faff659 (diff) | |
download | postgresql-fbb1d7d73f8e23a3a61e702629c53cef48cb0918.tar.gz postgresql-fbb1d7d73f8e23a3a61e702629c53cef48cb0918.zip |
Allow CREATE/ALTER DATABASE to manipulate datistemplate and datallowconn.
Historically these database properties could be manipulated only by
manually updating pg_database, which is error-prone and only possible for
superusers. But there seems no good reason not to allow database owners to
set them for their databases, so invent CREATE/ALTER DATABASE options to do
that. Adjust a couple of places that were doing it the hard way to use the
commands instead.
Vik Fearing, reviewed by Pavel Stehule
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/alter_database.sgml | 22 | ||||
-rw-r--r-- | doc/src/sgml/ref/create_database.sgml | 24 |
2 files changed, 46 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/alter_database.sgml b/doc/src/sgml/ref/alter_database.sgml index 23ef75512f1..3724c05e2c0 100644 --- a/doc/src/sgml/ref/alter_database.sgml +++ b/doc/src/sgml/ref/alter_database.sgml @@ -25,6 +25,8 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <rep <phrase>where <replaceable class="PARAMETER">option</replaceable> can be:</phrase> + IS_TEMPLATE <replaceable class="PARAMETER">istemplate</replaceable> + ALLOW_CONNECTIONS <replaceable class="PARAMETER">allowconn</replaceable> CONNECTION LIMIT <replaceable class="PARAMETER">connlimit</replaceable> ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RENAME TO <replaceable>new_name</replaceable> @@ -107,6 +109,26 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RESET ALL </varlistentry> <varlistentry> + <term><replaceable class="parameter">istemplate</replaceable></term> + <listitem> + <para> + If true, then this database can be cloned by any user with CREATEDB + privileges; if false, then only superusers or the owner of the + database can clone it. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><replaceable class="parameter">allowconn</replaceable></term> + <listitem> + <para> + If false then no one can connect to this database. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><replaceable class="parameter">connlimit</replaceable></term> <listitem> <para> diff --git a/doc/src/sgml/ref/create_database.sgml b/doc/src/sgml/ref/create_database.sgml index 5af89815207..9711b1f98e3 100644 --- a/doc/src/sgml/ref/create_database.sgml +++ b/doc/src/sgml/ref/create_database.sgml @@ -28,6 +28,8 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable> [ LC_COLLATE [=] <replaceable class="parameter">lc_collate</replaceable> ] [ LC_CTYPE [=] <replaceable class="parameter">lc_ctype</replaceable> ] [ TABLESPACE [=] <replaceable class="parameter">tablespace_name</replaceable> ] + [ IS_TEMPLATE [=] <replaceable class="parameter">istemplate</replaceable> ] + [ ALLOW_CONNECTIONS [=] <replaceable class="parameter">allowconn</replaceable> ] [ CONNECTION LIMIT [=] <replaceable class="parameter">connlimit</replaceable> ] ] </synopsis> </refsynopsisdiv> @@ -148,6 +150,28 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable> </varlistentry> <varlistentry> + <term><replaceable class="parameter">istemplate</replaceable></term> + <listitem> + <para> + If true, then this database can be cloned by any user with CREATEDB + privileges; if false (the default), then only superusers or the owner + of the database can clone it. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><replaceable class="parameter">allowconn</replaceable></term> + <listitem> + <para> + If false then no one can connect to this database. The default is + true, allowing connections (except as restricted by other mechanisms, + such as <literal>GRANT</>/<literal>REVOKE CONNECT</>). + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><replaceable class="parameter">connlimit</replaceable></term> <listitem> <para> |