⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 createdb.1

📁 PostgreSQL 8.2中增加了很多企业用户所需要的功能和性能上的提高,其开发团队说,该版本将加速更多企业向该数据库移植.核心开发成员之一Bruce Momjian表示,在新版PostgreSQL
💻 1
字号:
.\\" auto-generated by docbook2man-spec $Revision: 1.1.1.1 $.TH "CREATEDB" "1" "2008-01-03" "Application" "PostgreSQL Client Applications".SH NAMEcreatedb \- create a new PostgreSQL database.SH SYNOPSIS.sp\fBcreatedb\fR [ \fB\fIoption\fB\fR\fI...\fR ]  [ \fB\fIdbname\fB\fR ]  [ \fB\fIdescription\fB\fR ] .SH "DESCRIPTION".PP\fBcreatedb\fR creates a new PostgreSQLdatabase..PPNormally, the database user who executes this command becomes the owner ofthe new database.However a different owner can be specified via the \fB-O\fRoption, if the executing user has appropriate privileges..PP\fBcreatedb\fR is a wrapper around theSQL command CREATE DATABASE [\fBcreate_database\fR(7)].There is no effective difference between creating databases viathis utility and via other methods for accessing the server..SH "OPTIONS".PP\fBcreatedb\fR accepts the following command-line arguments:.TP\fB\fIdbname\fB\fRSpecifies the name of the database to be created. The name must beunique among all PostgreSQL databases in this cluster.The default is to create a database with the same name as thecurrent system user..TP\fB\fIdescription\fB\fRSpecifies a comment to be associated with the newly createddatabase..TP\fB-D \fItablespace\fB\fR.TP\fB--tablespace \fItablespace\fB\fRSpecifies the default tablespace for the database..TP\fB-e\fR.TP\fB--echo\fREcho the commands that \fBcreatedb\fR generatesand sends to the server..TP\fB-E \fIencoding\fB\fR.TP\fB--encoding \fIencoding\fB\fRSpecifies the character encoding scheme to be used in thisdatabase. The character sets supported by thePostgreSQL server are described inin the documentation..TP\fB-O \fIowner\fB\fR.TP\fB--owner \fIowner\fB\fRSpecifies the database user who will own the new database..TP\fB-q\fR.TP\fB--quiet\fRDo not display a response..TP\fB-T \fItemplate\fB\fR.TP\fB--template \fItemplate\fB\fRSpecifies the template database from which to build this database..PP.PPThe options \fB-D\fR, \fB-E\fR,\fB-O\fR, and\fB-T\fR correspond to options of the underlyingSQL command CREATE DATABASE [\fBcreate_database\fR(7)]; see there for more informationabout them..PP\fBcreatedb\fR also accepts the followingcommand-line arguments for connection parameters:.TP\fB-h \fIhost\fB\fR.TP\fB--host \fIhost\fB\fRSpecifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket..TP\fB-p \fIport\fB\fR.TP\fB--port \fIport\fB\fRSpecifies the TCP port or the local Unix domain socket file extension on which the server is listening for connections..TP\fB-U \fIusername\fB\fR.TP\fB--username \fIusername\fB\fRUser name to connect as.TP\fB-W\fR.TP\fB--password\fRForce password prompt..PP.SH "ENVIRONMENT".TP\fBPGDATABASE\fRIf set, the name of the database to create, unless overridden onthe command line..TP\fBPGHOST\fR.TP\fBPGPORT\fR.TP\fBPGUSER\fRDefault connection parameters. \fBPGUSER\fR alsodetermines the name of the database to create, if it is notspecified on the command line or by \fBPGDATABASE\fR..PPThis utility, like most other PostgreSQL utilities,also uses the environment variables supported by \fBlibpq\fR(see in the documentation)..PP.SH "DIAGNOSTICS".PPIn case of difficulty, see CREATE DATABASE [\fBcreate_database\fR(7)] and \fBpsql\fR(1) fordiscussions of potential problems and error messages.The database server must be running at thetargeted host. Also, any default connection settings and environmentvariables used by the \fBlibpq\fR front-endlibrary will apply..SH "EXAMPLES".PPTo create the database demo using the defaultdatabase server:.sp.nf$ \fBcreatedb demo\fRCREATE DATABASE.sp.fiThe response is the same as you would have gotten from running the\fBCREATE DATABASE\fR SQL command..PPTo create the database demo using theserver on host eden, port 5000, using theLATIN1 encoding scheme with a look at theunderlying command:.sp.nf$ \fBcreatedb -p 5000 -h eden -E LATIN1 -e demo\fRCREATE DATABASE "demo" WITH ENCODING = 'LATIN1'CREATE DATABASE.sp.fi.SH "SEE ALSO"\fBdropdb\fR(1), CREATE DATABASE [\fBcreate_database\fR(7)]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -