Skip to content

Instantly share code, notes, and snippets.

@dPacc
Created August 17, 2022 06:31
Show Gist options
  • Save dPacc/bbb15f4ccad91b9c4a2c9a117e100150 to your computer and use it in GitHub Desktop.
Save dPacc/bbb15f4ccad91b9c4a2c9a117e100150 to your computer and use it in GitHub Desktop.
Restore SQL Dump in Postrgres
  • Connect to DB: psql -U postgres

  • Create a new DB: create database DB_NAME;

  • Connect to the DB: \c DB_NAME

  • To restore: \i DUMP_NAME.SQL

  • Now to view schemas in the DB: \dn

  • By default there will be 2 schemas doc and public

  • To connect to a schema: set search_path to doc;

  • To view all the relations in the schema: \d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment