ALTER DATABASE

Synopsis

Use the ALTER DATABASE statement to redefine the attributes of a database.

Syntax

  1. alter_database ::= ALTER DATABASE name
  2. [ [ WITH ] alter_database_option [ ... ]
  3. | RENAME TO name
  4. | OWNER TO { new_owner
  5. | CURRENT_USER
  6. | SESSION_USER }
  7. | SET TABLESPACE new_tablespace
  8. | SET configuration_parameter { TO | = }
  9. { value | DEFAULT }
  10. | SET configuration_parameter FROM CURRENT
  11. | RESET configuration_parameter
  12. | RESET ALL ]
  13. alter_database_option ::= ALLOW_CONNECTIONS allowconn
  14. | CONNECTION LIMIT connlimit
  15. | IS_TEMPLATE istemplate

alter_database

ALTER DATABASE - 图1

alter_database_option

ALTER DATABASE - 图2

Semantics

NoteSome options in DATABASE are under development.

name

Specify the name of the database to be altered.

tablespace_name

Specify the new tablespace that is associated with the database.

ALLOW_CONNECTIONS

Specify false to disallow connections to this database. Default is true, which allows this database to be cloned by any user with CREATEDB privileges.

CONNECTION_LIMIT

Specify how many concurrent connections can be made to this database. Default of -1 allows unlimited concurrent connections.

IS_TEMPLATE

Strue — This database can be cloned by any user with CREATEDB privileges.Specify false to Only superusers or the owner of the database can clone it.

See also