Skip to content

Instantly share code, notes, and snippets.

@gyfoster
Created April 8, 2019 16:11
Show Gist options
  • Save gyfoster/4ff5d73b4e0c8e5c758e3ec3c7403d04 to your computer and use it in GitHub Desktop.
Save gyfoster/4ff5d73b4e0c8e5c758e3ec3c7403d04 to your computer and use it in GitHub Desktop.
A list of useful Postgres commands
Log into postgres via command line:
$ psql -h <host> -p <port> -U <username> -d <database>
Run script from command line:
$ psql -h <host> -p <port> -U <username> -d <database> -f <sql-script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment