Skip to content

Instantly share code, notes, and snippets.

@J-Yaghoubi
Last active October 1, 2023 14:32
Show Gist options
  • Select an option

  • Save J-Yaghoubi/8f3bf86876844ec9acd07b920b3d32f5 to your computer and use it in GitHub Desktop.

Select an option

Save J-Yaghoubi/8f3bf86876844ec9acd07b920b3d32f5 to your computer and use it in GitHub Desktop.

conect to postgres through psql:

psql -h <host> -U <username> -p <port>

list of users:

\du

list of databases:

\l

choice database:

\c <db-name>

list of tables in current database:

\dt *.*

table informations (columns name and type, indexes, etc):

\d <table-name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment