createdb
PostgreSQL database creation utility
TLDR
Create database
SYNOPSIS
createdb [options] [dbname] [description]
DESCRIPTION
createdb creates a PostgreSQL database. It is a convenience wrapper around the SQL CREATE DATABASE command, providing a command-line interface that's often more convenient than invoking psql directly.
The utility connects to the PostgreSQL server (typically to the postgres or template1 database) and executes the CREATE DATABASE SQL command with the specified parameters. This avoids the need to launch psql interactively just to create a database.
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.
