Create a database at /usr/local/var/postgres

initdb

  • Create a PostgreSQL database on disk.
    More information: <https://www.postgresql.org/docs/9.5/app-initdb.html>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

initdb -D /usr/local/var/postgres

click the source code to copy install initdb on any operating system with command-not-found.com