YMatrix
Quick Start
Simulate Time Series Scenarios
Standard Cluster Deployment
Data Modeling
Connecting to The database
Data Writing
Data Migration
Data Query
Scene Application Examples
Federal Query
Maintenance and Monitoring
Global Maintenance
Partition Maintenance
Backup and Restore
Cluster Expansion
Enable Mirroring
Resource Management
Security
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool Guide
Data Type
Storage Engine
Execution Engine
Stream Processing
DR (Disaster Recovery)
Configuration Parameters
Index
Extension
SQL Reference
FAQ
Modify the properties of the database
ALTER DATABASE name [ WITH CONNECTION LIMIT connlimit ]
ALTER DATABASE name RENAME TO newname
ALTER DATABASE name OWNER TO new_owner
ALTER DATABASE name SET TABLESPACE new_tablespace
ALTER DATABASE name SET parameter { TO | = } { value | DEFAULT }
ALTER DATABASE name SET parameter FROM CURRENT
ALTER DATABASE name RESET parameter
ALTER DATABASE name RESET ALL
ALTER DATABASE Modify the properties of a database.
The first statement changes the number of connections to the database. Only the owner or superuser of the data can change this setting.
The second statement changes the name of the database. Only the database owner or superuser can rename the database; non-superusers must have CREATEDB permissions. You cannot modify the name of the current database and connect to another database first.
The third gathers the owner of the modified database. To modify the owner, you must be a direct or indirect member of the new role, and you must have CREATEDB permissions. (Super users can automatically have all permissions.)
The fourth statement changes the default tablespace of the database. Only the database owner or superuser can modify the default table empty, and you also need to have the permission to create on the new tablespace. This command will move all tables and indexes in the default tablespace of this database to the new tablespace. Note that tables and indexes not in the default tablespace are not affected.
The remaining statements are used to modify the default values of the YMatrix database session level parameter. When a session is opened in the database, the parameter value provided by this session will become the default parameter value. The default value of the database configuration in the configuration file (postgresql.conf) will be overwritten. Only the database owner or superuser can modify the session default value. Some parameters cannot be set in this way, or can only be set by superusers.
name
connlimit
parameter value
newname
new_owner
new_tablespace
You can also set configuration parameter session default values for specific roles (users) instead of databases. If there is a conflict, role-specific settings override database-specific settings. See ALTER ROLE.
Set the default schema search path for the database mydatabase:
ALTER DATABASE mydatabase SET search_path TO myschema,
public, pg_catalog;
The ALTER DATABASE statement is an extension statement of YMatrix.