.\" This is -*-nroff-*- .\" XXX standard disclaimer belongs here.... .\" /usr/local/devel/postgres-4.2-devel/src/ref/unix/RCS/createdb.1src,v 1.17 1993/02/06 00:34:44 devine Exp .TH CREATEDB UNIX 01/23/93 .XA 1 Createdb .SH NAME createdb \(em create a database .SH SYNOPSIS .BR createdb [\c .BR -a system] [\c .BR -h host] [\c .BR -p port] [dbname] .SH DESCRIPTION .IR Createdb creates a new database. The person who executes this command becomes the database administrator, or DBA, for this database and is the only person, other than the \*(PG super-user, who can destroy it. .PP .IR Createdb is a shell script that invokes the \*(PG .IR monitor . Hence, a .IR postmaster process must be running on the database server host before .IR createdb is executed. In addition, the .SM PGOPTION and .SM PGREALM environment variables will be passed on to .IR monitor and processed as described in .IR monitor (unix). .PP The optional argument .IR dbname specifies the name of the database to be created. The name must be unique among all \*(PG databases. .IR Dbname defaults to the value of the .SM USER environment variable. .PP .IR Createdb understands the following command-line options: .TP 5n .BR "-a" " system" Specifies an authentication system .IR "system" (see .IR introduction (unix)) to use in connecting to the .IR postmaster process. The default is site-specific. .TP .BR "-h" " host" Specifies the hostname of the machine on which the .IR postmaster is running. Defaults to the name of the local host, or the value of the .SM PGHOST environment variable (if set). .TP .BR "-p" " port" Specifies the Internet TCP port on which the .IR postmaster is listening for connections. Defaults to 4321, or the value of the .SM PGPORT environment variable (if set). .SH EXAMPLES .(C # create the demo database createdb demo .)C .(C # create the demo database using the postmaster on host eden, # port 1234, using the Kerberos authentication system. createdb -a kerberos -p 1234 -h eden demo .)C .SH FILES .TP 5n \&$PGDATA/base/\fIdbname\fP The location of the files corresponding to the database .IR dbname . .SH "SEE ALSO" createdb(commands), destroydb(unix), initdb(unix), monitor(unix), postmaster(unix). .SH DIAGNOSTICS .TP 5n .BI "Error: Failed to connect to backend (host=" "xxx" ", port=" "xxx" ")" .IR Createdb could not attach to the .IR postmaster process on the specified host and port. If you see this message, ensure that the .IR postmaster is running on the proper host and that you have specified the proper port. If your site uses an authentication system, ensure that you have obtained the required authentication credentials. .TP .BI "user \*(lq" "username" "\*(rq is not in \*(lqpg_user\*(rq" You do not have a valid entry in the relation \*(lqpg_user\*(rq and cannot do anything with \*(PG at all; contact your \*(PG site administrator. .TP .BI "user \*(lq" "username" "\*(rq is not allowed to create/destroy databases" You do not have permission to create new databases; contact your \*(PG site administrator. .TP .IB "dbname" " already exists" The database already exists. .TP .BI "database creation failed on" " dbname" An internal error occurred in .IR monitor or the backend server. Ensure that your \*(PG site administrator has properly installed \*(PG and initialized the site with .IR initdb .