createdb
TLDR
Create database
$ createdb [dbname]
Create with owner$ createdb -O [owner] [dbname]
Create with encoding$ createdb -E [UTF8] [dbname]
Create from template$ createdb -T [template0] [dbname]
Create on remote server$ createdb -h [hostname] -p [5432] -U [user] [dbname]
Create with tablespace$ createdb -D [tablespace] [dbname]
Show executed SQL$ createdb -e [dbname]
SYNOPSIS
createdb [options] [dbname] [description]
DESCRIPTION
createdb creates a PostgreSQL database. Wrapper around SQL CREATE DATABASE command. Connects to postgres database to issue the command.
PARAMETERS
-D tablespace, --tablespace tablespace
Default tablespace-E encoding, --encoding encoding
Character encoding-l locale, --locale locale
Locale for database-O owner, --owner owner
Database owner-T template, --template template
Template database-e, --echo
Show commands sent to server--strategy strategy
Database creation strategy
CONNECTION OPTIONS
-h host, --host host
Server hostname-p port, --port port
Server port-U user, --username user
Connect as user-w, --no-password
Never prompt for password-W, --password
Force password prompt--maintenance-db db
Connection database
DEFAULTS
Database name defaults to current system user. Connects to postgres database (or template1) to create new database.
CAVEATS
Requires CREATEDB privilege or superuser role. Default template is template1. Use template0 for clean database without local additions.


