alter_database.7
来自「PostgreSQL 8.2中增加了很多企业用户所需要的功能和性能上的提高,其开」· 7 代码 · 共 105 行
7
105 行
.\\" auto-generated by docbook2man-spec $Revision: 1.1.1.1 $.TH "ALTER DATABASE" "" "2008-01-03" "SQL - Language Statements" "SQL Commands".SH NAMEALTER DATABASE \- change a database.SH SYNOPSIS.sp.nfALTER DATABASE \fIname\fR [ [ WITH ] \fIoption\fR [ ... ] ]where \fIoption\fR can be: CONNECTION LIMIT \fIconnlimit\fRALTER DATABASE \fIname\fR SET \fIparameter\fR { TO | = } { \fIvalue\fR | DEFAULT }ALTER DATABASE \fIname\fR RESET \fIparameter\fRALTER DATABASE \fIname\fR RENAME TO \fInewname\fRALTER DATABASE \fIname\fR OWNER TO \fInew_owner\fR.sp.fi.SH "DESCRIPTION".PP\fBALTER DATABASE\fR changes the attributesof a database..PPThe first form changes certain per-database settings. (See below fordetails.) Only the database owner or a superuser can change these settings..PPThe second and third forms change the session default for a run-timeconfiguration variable for a PostgreSQLdatabase. Whenever a new session is subsequently started in thatdatabase, the specified value becomes the session default value.The database-specific default overrides whatever setting is presentin \fIpostgresql.conf\fR or has been received from the\fBpostgres\fR command line. Only the databaseowner or a superuser can change the session defaults for adatabase. Certain variables cannot be set this way, or can only beset by a superuser..PPThe fourth form changes the name of the database. Only the databaseowner or a superuser can rename a database; non-superuser owners mustalso have theCREATEDB privilege. The current database cannotbe renamed. (Connect to a different database if you need to dothat.).PPThe fifth form changes the owner of the database.To alter the owner, you must own the database and also be a direct orindirect member of the new owning role, and you must have theCREATEDB privilege.(Note that superusers have all these privileges automatically.).SH "PARAMETERS".TP\fB\fIname\fB\fRThe name of the database whose attributes are to be altered..TP\fB\fIconnlimit\fB\fRHow many concurrent connections can be madeto this database. -1 means no limit..TP\fB\fIparameter\fB\fR.TP\fB\fIvalue\fB\fRSet this database's session default for the specified configurationparameter to the given value. If\fIvalue\fR is DEFAULTor, equivalently, RESET is used, thedatabase-specific setting is removed, so the system-wide defaultsetting will be inherited in new sessions. Use RESETALL to clear all database-specific settings.See SET [\fBset\fR(7)] and in the documentationfor more information about allowed parameter namesand values..TP\fB\fInewname\fB\fRThe new name of the database..TP\fB\fInew_owner\fB\fRThe new owner of the database..SH "NOTES".PPIt is also possible to tie a session default to a specific userrather than to a database; seeALTER USER [\fBalter_user\fR(7)].User-specific settings override database-specificones if there is a conflict..SH "EXAMPLES".PPTo disable index scans by default in the databasetest:.sp.nfALTER DATABASE test SET enable_indexscan TO off;.sp.fi.SH "COMPATIBILITY".PPThe \fBALTER DATABASE\fR statement is aPostgreSQL extension..SH "SEE ALSO"CREATE DATABASE [\fBcreate_database\fR(7)], DROP DATABASE [\fBdrop_database\fR(l)], SET [\fBset\fR(l)]
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?