X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=doc%2Fsrc%2Fsgml%2Fref%2Falter_database.sgml;h=3724c05e2c0cfd6c1128094d9545747f8a75970c;hb=fbb1d7d73f8e23a3a61e702629c53cef48cb0918;hp=d16cc2fdad1a0b889d34d94b00f0d85469284d68;hpb=e7889b83b7059e776f0a3d76bbbdd98687f4592c;p=postgresql diff --git a/doc/src/sgml/ref/alter_database.sgml b/doc/src/sgml/ref/alter_database.sgml index d16cc2fdad..3724c05e2c 100644 --- a/doc/src/sgml/ref/alter_database.sgml +++ b/doc/src/sgml/ref/alter_database.sgml @@ -1,11 +1,16 @@ + + ALTER DATABASE + + - ALTER DATABASE + ALTER DATABASE + 7 SQL - Language Statements @@ -14,22 +19,22 @@ PostgreSQL documentation change a database - - ALTER DATABASE - - ALTER DATABASE name [ [ WITH ] option [ ... ] ] -where option can be: +where option can be: + IS_TEMPLATE istemplate + ALLOW_CONNECTIONS allowconn CONNECTION LIMIT connlimit -ALTER DATABASE name RENAME TO newname +ALTER DATABASE name RENAME TO new_name ALTER DATABASE name OWNER TO new_owner +ALTER DATABASE name SET TABLESPACE new_tablespace + ALTER DATABASE name SET configuration_parameter { TO | = } { value | DEFAULT } ALTER DATABASE name SET configuration_parameter FROM CURRENT ALTER DATABASE name RESET configuration_parameter @@ -48,7 +53,7 @@ ALTER DATABASE name RESET ALL The first form changes certain per-database settings. (See below for details.) Only the database owner or a superuser can change these settings. - + The second form changes the name of the database. Only the database @@ -67,6 +72,15 @@ ALTER DATABASE name RESET ALL (Note that superusers have all these privileges automatically.) + + The fourth form changes the default tablespace of the database. + Only the database owner or a superuser can do this; you must also have + create privilege for the new tablespace. + This command physically moves any tables or indexes in the database's old + default tablespace to the new tablespace. Note that tables and indexes + in non-default tablespaces are not affected. + + The remaining forms change the session default for a run-time configuration variable for a PostgreSQL @@ -95,6 +109,26 @@ ALTER DATABASE name RESET ALL + istemplate + + + 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. + + + + + + allowconn + + + If false then no one can connect to this database. + + + + + connlimit @@ -102,10 +136,10 @@ ALTER DATABASE name RESET ALL to this database. -1 means no limit. - + - newname + new_name The new name of the database. @@ -122,6 +156,15 @@ ALTER DATABASE name RESET ALL + + new_tablespace + + + The new default tablespace of the database. + + + + configuration_parameter value @@ -139,7 +182,7 @@ ALTER DATABASE name RESET ALL - See and + See and for more information about allowed parameter names and values. @@ -154,7 +197,7 @@ ALTER DATABASE name RESET ALL It is also possible to tie a session default to a specific role rather than to a database; see - . + . Role-specific settings override database-specific ones if there is a conflict. @@ -169,13 +212,12 @@ ALTER DATABASE name RESET ALL ALTER DATABASE test SET enable_indexscan TO off; - - + Compatibility - + The ALTER DATABASE statement is a PostgreSQL extension. @@ -186,9 +228,10 @@ ALTER DATABASE test SET enable_indexscan TO off; See Also - - - + + + +