Creates a new database.
createdb [<connection-option> ...] [<option> ...] [<dbname> ['<description>']]
createdb -? | --help
createdb -V | --version
createdb
creates a new database in a Greenplum Database system.
Normally, the database user who runs this command becomes the owner of the new database. However, a different owner can be specified via the -O
option, if the executing user has appropriate privileges.
createdb
is a wrapper around the SQL command CREATE DATABASE .
PGDATABASE
, then
PGUSER
or defaults to the current system user.
createdb
generates and sends to the server.
'UTF8'
), an integer encoding number, or
DEFAULT
to use the default encoding. See the Greenplum Database Reference Guide for information about supported character sets.
--lc-collate
and
--lc-ctype
.
LC_COLLATE
setting to be used in this database.
LC_CTYPE
setting to be used in this database.
template1
. (This name is processed as a double-quoted identifier.)
createdb
version and exit.
createdb
command line arguments, and exit.
The options -D
, -l
, -E
, -O
, and -T
correspond to options of the underlying SQL command CREATE DATABASE
; see CREATE DATABASE in the Greenplum Database Reference Guide for more information about them.
Connection Options
PGHOST
or defaults to localhost.
PGPORT
or defaults to 5432.
PGUSER
or defaults to the current system role name.
.pgpass
file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.
postgres
database will be used; if that does not exist (or if it is the name of the new database being created),
template1
will be used.
To create the database test
using the default options:
createdb test
To create the database demo
using the Greenplum master on host gpmaster
, port 54321
, using the LATIN1
encoding scheme:
createdb -p 54321 -h gpmaster -E LATIN1 demo