createdb

Create a PostgreSQL database. More information: <https://www.postgresql.org/docs/current/app-createdb.html>.

Install

All systems
curl cmd.cat/createdb.sh
Debian Debian
apt-get install postgresql-client-9.1
Ubuntu
apt-get install postgresql-client-9.3
Alpine
apk add postgresql
Arch Arch Linux
pacman -S postgresql-old-upgrade
image/svg+xml Kali Linux
apt-get install postgresql-client-11
CentOS
yum install postgresql
Fedora
dnf install postgresql
Windows (WSL2)
sudo apt-get update sudo apt-get install postgresql-client-9.3
OS X
brew install postgresql
Raspbian
apt-get install postgresql-client-9.5
Docker
docker run cmd.cat/createdb createdb powered by Commando

Create a PostgreSQL database. More information: <https://www.postgresql.org/docs/current/app-createdb.html>.

  • Create a database owned by the current user:
    createdb database_name
  • Create a database owned by a specific user with a description:
    createdb --owner=username database_name 'description'
  • Create a database from a template:
    createdb --template=template_name database_name

© tl;dr; authors and contributors