Skip to content

Instantly share code, notes, and snippets.

@thefonso
Created July 2, 2019 05:06
Show Gist options
  • Save thefonso/c26b49d2d8542267a8dc8d5f17733ea8 to your computer and use it in GitHub Desktop.
Save thefonso/c26b49d2d8542267a8dc8d5f17733ea8 to your computer and use it in GitHub Desktop.

Revisions

  1. @mnvr mnvr revised this gist Jan 15, 2015. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions postgresql_mac.md
    Original file line number Diff line number Diff line change
    @@ -36,6 +36,10 @@ Then create a database named `fsbook` with the newly created user.
    $ createdb --username=fsuser --password fsbook
    Password: fspass

    Connect.

    $ psql --username=fsuser --password fsbook

    ### Appendix: Versions used when creating this document

    $ postgres --version
  2. @mnvr mnvr revised this gist Jan 15, 2015. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions postgresql_mac.md
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,18 @@ Connect via the CLI

    $ psql

    ### Appendix: Adding additional users

    Create a database user named `fsuser` with a password `fspass`.

    $ createuser fsuser --createdb --password
    Password: fspass

    Then create a database named `fsbook` with the newly created user.

    $ createdb --username=fsuser --password fsbook
    Password: fspass

    ### Appendix: Versions used when creating this document

    $ postgres --version
  3. @mnvr mnvr created this gist Jan 15, 2015.
    36 changes: 36 additions & 0 deletions postgresql_mac.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    ## PostgreSQL on Mac OS X

    Install, and verify the installation.

    $ brew install postgresql
    $ postgres —help
    postgres is the PostgreSQL server.
    ...
    $ psql --help
    psql is the PostgreSQL interactive terminal.
    ...

    Start server instance

    $ postgres -D /usr/local/var/postgres

    In a separate terminal, create a DB with the same name as
    the current UNIX user. This makes it easier to access the
    server with the psql command.

    createdb `whoami`

    Connect via the CLI

    $ psql

    ### Appendix: Versions used when creating this document

    $ postgres --version
    postgres (PostgreSQL) 9.4.0
    $ sw_vers -productVersion # Mac OS X
    10.9.5

    ### References:

    * <https://www.codefellows.org/blog/three-battle-tested-ways-to-install-postgresql>