ALTER DATABASE
Changes the attributes of a database.
Synopsis
ALTER DATABASE <name> SET <parameter> { TO | = } { <value> | DEFAULT }
ALTER DATABASE <name> RESET <parameter>
Description
ALTER DATABASE
changes the attributes of a HAWQ database.
SET
and RESET
hawq-site.xml
). Only the database owner or a superuser can change the session defaults for a database. Certain parameters cannot be set this way, or can only be set by a superuser.
Parameters
The name of the database whose attributes are to be altered.
Note: HAWQ reserves the database “hcatalog” for system use. You cannot connect to or alter the system “hcatalog” database.
Set this database’s session default for the specified configuration parameter to the given value. If value is DEFAULT
or if RESET
is used, the database-specific setting is removed, so the system-wide default setting will be inherited in new sessions. Use RESET ALL
to clear all database-specific settings. See About Server Configuration Parameters for information about user-settable configuration parameters.
Notes
It is also possible to set a configuration parameter session default for a specific role (user) rather than to a database. Role-specific settings override database-specific ones if there is a conflict. See ALTER ROLE.
Examples
To set the default schema search path for the mydatabase
database:
ALTER DATABASE mydatabase SET search_path TO myschema,
public, pg_catalog;
Compatibility
The ALTER DATABASE
statement is a HAWQ extension.