head 1.17; access; symbols; locks; strict; comment @# @; 1.17 date 93.02.06.00.34.44; author devine; state Exp; branches; next 1.16; 1.16 date 93.01.26.02.43.13; author aoki; state Exp; branches; next 1.15; 1.15 date 92.07.14.05.54.17; author ptong; state Exp; branches; next 1.14; 1.14 date 92.07.13.03.45.59; author ptong; state Exp; branches; next 1.13; 1.13 date 92.06.17.22.05.15; author mer; state Exp; branches; next 1.12; 1.12 date 91.08.16.02.20.37; author kemnitz; state Exp; branches; next 1.11; 1.11 date 91.08.13.20.14.46; author kemnitz; state Exp; branches; next 1.10; 1.10 date 91.08.11.19.06.42; author mao; state Exp; branches; next 1.9; 1.9 date 91.03.09.05.09.11; author kemnitz; state Exp; branches; next 1.8; 1.8 date 91.03.08.01.38.39; author kemnitz; state Exp; branches; next 1.7; 1.7 date 91.02.22.16.39.59; author mike; state Exp; branches; next 1.6; 1.6 date 90.10.27.21.16.20; author kemnitz; state Exp; branches; next 1.5; 1.5 date 90.10.27.21.14.56; author kemnitz; state Exp; branches; next 1.4; 1.4 date 90.08.27.14.56.58; author kemnitz; state Exp; branches; next 1.3; 1.3 date 90.08.10.13.52.19; author cimarron; state Exp; branches; next 1.2; 1.2 date 90.07.19.15.41.13; author claire; state Exp; branches; next 1.1; 1.1 date 90.07.18.16.23.12; author mao; state Exp; branches; next ; desc @man page for shell-level 'createdb' command @ 1.17 log @removed C style comments, used sh comments instead @ text @.\" This is -*-nroff-*- .\" XXX standard disclaimer belongs here.... .\" $Header: /usr/local/devel/postgres/ref/unix/RCS/createdb.1src,v 1.16 1993/01/26 02:43:13 aoki Exp devine $ .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 . @ 1.16 log @-man version @ text @d3 1 a3 1 .\" $Header: /home2/aoki/ref/unix/RCS/createdb,v 1.15 1992/07/14 05:54:17 ptong Exp aoki $ d27 1 a27 1 is a shell script that invokes d79 1 a79 3 /* * create the demo database */ d83 2 a84 4 /* * create the demo database using the postmaster on host eden, * port 1234, using the Kerberos authentication system. */ @ 1.15 log @reformated @ text @d1 1 d3 2 a4 2 .\" $Header: /home/postgres/mer/refs/unix/RCS/createdb,v 1.14 1992/07/13 03:45:59 ptong Exp ptong $ .SP CREATEDB UNIX 6/14/90 d6 29 a34 31 .uh NAME .lp createdb \*- create a database .uh SYNOPSIS .lp .(l \fBcreatedb\fR [\fB-p\fR port] [\fB-h\fR host] username .)l .uh DESCRIPTION .lp .b Createdb creates a new database. The person who executes this command becomes the database administrator .r ( \c .A DBA ) for this database. The .A DBA has special powers not granted to ordinary users. Namely, they can destroy the database they created. .lp .i Dbname is the name of the database to be created. The name must be unique among all \*(PP databases. .lp The argument .i port d36 89 a124 30 .i hostname are the same as in the terminal monitor - they are used to connect to the postmaster using the TCP/IP port .i port running on the database server .i hostname. The defaults are to the local machine (localhost) and to the default port (4321). .lp .uh "SEE ALSO" .lp destroydb(unix), initdb(unix), createdb(commands). .uh DIAGNOSTICS .sp .lp \fBError: Failed to connect to backend (host=\fIxxx\fB, port=\fIxxx\fB)\fR .lp createdb could not attach to the postmaster on the specified host and port. If you see this message, check that the postmaster is running on the proper host and that the proper port is specified. .sp .lp \fBYou are not a valid POSTGRES user\fR .lp You do not have a users file entry, and can not do anything with \*(PP at all. .sp .lp \fI\fR \fBalready exists\fR .lp d126 7 @ 1.14 log @Fixed up formating @ text @d2 1 a2 1 .\" $Header: /home/postgres/mer/refs/unix/RCS/createdb,v 1.13 1992/06/17 22:05:15 mer Exp ptong $ d48 1 a48 3 destroydb(unix), initdb(unix), createdb(postquel). d59 1 a59 1 You are not a valid \*(PP user d65 1 a65 1 already exists @ 1.13 log @add some diagnostics @ text @d2 1 a2 1 .\" $Header: /home/postgres/mer/refs/unix/RCS/createdb,v 1.12 1991/08/16 02:20:37 kemnitz Exp mer $ d10 3 a12 3 .b createdb [-p port][-h host] .b dbname @ 1.12 log @*** empty log message *** @ text @d2 1 a2 1 .\" $Header: RCS/createdb,v 1.11 91/08/13 20:14:46 kemnitz Exp $ d11 1 a11 1 [-p port -h host] d25 2 a26 1 not granted to ordinary users. d52 8 @ 1.11 log @fixed indenting @ text @d2 1 a2 1 .\" $Header: RCS/createdb,v 1.10 91/08/11 19:06:42 mao Exp Locker: kemnitz $ a44 6 As of release 3.0 of POSTGRES, this command is a shell script that executes the Postquel query .i createdb from inside the template database. See the Postquel reference manual for details. @ 1.10 log @update for 3.0 @ text @d2 1 a2 1 .\" $Header: /local/mao/postgres/ref/unix/RCS/createdb,v 1.9 1991/03/09 05:09:11 kemnitz Exp mao $ d59 1 a59 1 .pp d65 1 a65 1 .pp @ 1.9 log @Added mention of initdb. @ text @d2 1 a2 1 .\" $Header: RCS/createdb,v 1.8 91/03/08 01:38:39 kemnitz Exp Locker: kemnitz $ d26 1 a26 1 .sp d32 1 a32 1 .sp d44 7 d54 2 a55 1 initdb(unix). @ 1.8 log @added command line arguments - now talks to postmaster. @ text @d2 1 a2 1 .\" $Header: RCS/createdb,v 1.6 90/10/27 21:16:20 kemnitz Exp $ d46 2 a47 1 destroydb(unix). @ 1.7 log @ok for 2.1 @ text @d2 1 a2 1 .\" $Header: RCS/createdb,v 1.6 90/10/27 21:16:20 kemnitz Exp Locker: mike $ d10 3 a12 1 .b createdb dbname d33 11 a43 12 After issuing this command, the program will usually respond with a diagnostic message in the following format: .nf .(l .q "created directory .../data/base/dbname" .q "creating database dbname" .)l .fi Then the \*(UU shell prompt will reappear. .lp Createdb will place all new databases in a directory named \&.../data/base/dbname. @ 1.6 log @Fixed some cosmetic shit. @ text @d2 1 a2 1 .\" $Header: RCS/createdb,v 1.5 90/10/27 21:14:56 kemnitz Exp Locker: kemnitz $ @ 1.5 log @Got rid of obsolete junk. @ text @d2 1 a2 1 .\" $Header: RCS/createdb,v 1.4 90/08/27 14:56:58 kemnitz Exp Locker: kemnitz $ d41 1 a41 1 \*(PP will place @ 1.4 log @Got rid of old options to control the vacuum daemon. @ text @d2 1 a2 1 .\" $Header: RCS/createdb,v 1.3 90/08/10 13:52:19 cimarron Exp Locker: kemnitz $ d41 1 a41 1 Unless otherwise instructed, \*(PP will place a42 22 To place a database elsewhere, the \*(PP superuser must first create a \fIreference file\fR in \&.../data/base/dbname containing a single line which is the full pathname of the desired location of the database. (The file must be owned by .b postgres and be in mode 600.) Then when the new database is created, it will be created in the file named, rather than in the directory \&.../data/base. For example, if the file \&.../data/base/userdb contained the line .(l /mnt/user/database .)l then the database called .q "userdb" would be physically stored in the directory /mnt/user/database rather than in the directory \&.../data/base/userdb. @ 1.3 log @cleaned up command line options section. @ text @d2 1 a2 1 .\" $Header: RCS/createdb,v 1.2 90/07/19 15:41:13 claire Exp Locker: cimarron $ d10 1 a10 17 .b createdb [ .b \-e ] [ .b \-v (on|off) ] [ .b \-t template-name ] [ .b \-h host ] [ .b \-p port ] dbname a64 79 .uh "COMMAND OPTIONS" .sp .nf \fI\-v on\fR \fI\-v off\fR .pp Specifying the \fI\-v on\fR or \fI\-v off\fR option turns the vacuum daemon for a new database on or off (default is off). We suggest that you run a vacuum demon on each active database. That way expired tuples will be purged according to the criteria set in the .b purge command for each relation. Also, this will ensure that the statistics kept in the RELATION relation are updated periodically. .sp .nf \fI-p port\fR \fI-h host\fR .pp The vacuum demon is associated with some postmaster process. Specifying the port and host using \fI-p port\fR and \fI-h host\fR will cause the vacuum demon to use the postmaster associated with the specified host and port. .sp .bp .nf \fI-e\fR .pp Often it is desireable to turn on or off a vacuum demon for an existing database. Specifying \fI-e\fR tells createdb not to attempt to create a new database in such circumstances. .sp .nf \fI-t template-name\fR .pp The optional .i template-name specifies a file, \&.../files/local1_\c .i template-name .ami, whose contents control the inclusion of system data types. See .b introduction (postquel) and .b template (files) for information on the use of templates. .uh EXAMPLE .lp .nf /* create a database named demo (with no vacuum daemon) */ createdb demo .fi .lp .nf /* enable the vacuum daemon for the production database */ createdb \-e \-v on production .fi .uh "ENVIRONMENT VARIABLES" .ip PGPORT The port on which the postmaster is running. This value is used if the .i -p option is not specified. If .i -p is not specified and PGPORT is not set, then the port defaults to 4321. .ip PGHOST The host on which the postmaster is running. This value is used if the .b -h option is not specified. If .b -h is not specified and PGHOST is not set, then the host defaults to "localhost". .uh FILES .lp \&.../files/data/base/* @ 1.2 log @*** empty log message *** @ text @d2 1 a2 1 .\" $Header: RCS/createdb,v 1.1 90/07/18 16:23:12 mao Exp Locker: claire $ d61 1 a61 1 must first create a file in \&.../data/base/dbname d81 8 a88 4 .lp The .b \-v on or \-v off turns the vacuum daemon for a new database on or off (default is off). d96 5 a100 1 .lp d102 15 a116 14 Specifying the port and host using [-p port] and [-h host] will cause the vacuum demon to be started on the specified host using the postmaster associated with the specified host and port. .lp A database option for an existing database may be modified by stating the .b \-e flag. The database is adjusted to conform to the specified option. .lp d142 7 a148 4 The port on which the postmaster is running. This value is overridden by the .b -p option. d150 2 a151 2 The host on which the postmaster is running. This value is overridden by the d153 4 a156 1 option. a164 4 .in +4 .ti -4 .ti -4 d166 1 a166 1 .br d169 4 a172 3 .ti -4 already exists .br a173 1 .ti -4 @ 1.1 log @Initial revision @ text @d2 1 a2 1 .\" $Header: createdb,v 1.10 89/04/25 09:16:27 wensel Exp $ d89 1 a89 1 (commands) command for each relation. Also, @