Skip to content

Instantly share code, notes, and snippets.

@chandu-io
Last active December 6, 2015 07:32
Show Gist options
  • Select an option

  • Save chandu-io/7c9997abf3aa7b5c720b to your computer and use it in GitHub Desktop.

Select an option

Save chandu-io/7c9997abf3aa7b5c720b to your computer and use it in GitHub Desktop.

PSQL commands

  1. List all schemas
\dn
  1. List all tables (regular expressions are available)
\dt
\dt public.*
\dt (public|test).*
\dt (public|test).(table1|table2)
\dt (public|test).table*
  1. Create new schema named test
create schema test;
  1. Use schema named test
set schema test;
  1. Get Postgres version
select version();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment