createdb

Creates a new database.

Synopsis

  1. createdb [<connection_options>] [<database_options>] [-e | --echo] [<dbname> ['<description>']]
  2. createdb --help
  3. createdb --version

where:

  1. <connection_options> =
  2. [-h <host> | --host <host>]
  3. [-p <port> | -- port <port>]
  4. [-U <username> | --username <username>]
  5. [-W | --password]
  6. <database_options> =
  7. [-D <tablespace> | --tablespace <tablespace>]
  8. [-E <encoding> | --encoding <encoding>]
  9. [-O <username> | --owner <username>]
  10. [-T <template>| --template <template>]

Description

createdb creates a new database in a HAWQ system.

Normally, the database user who executes 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.

Options

The name of the database to be created. The name must be unique among all other databases in the HAWQ system. If not specified, reads from the environment variable PGDATABASE, then PGUSER or defaults to the current system user.

Optional comment to be associated with the newly created database. Descriptions containing white space must be enclosed in quotes.

-e, –echo

Echo the commands that createdb generates and sends to the server.

-D, —tablespace

The default tablespace for the database.

-E, —encoding

Character set encoding to use in the new database. Specify a string constant (such as 'UTF8'), an integer encoding number, or DEFAULT to use the default encoding.

-O, —owner

The name of the database user who will own the new database. Defaults to the user executing this command.

-T, —template