Created
May 8, 2024 05:51
-
-
Save NaserKhoshfetrat/c5e7cef6dd2b8be7c1f7b8633a293daf to your computer and use it in GitHub Desktop.
postgres Psql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#login as superuser into postgres super user | |
.\psql.exe -u postgres | |
#show all database | |
\l | |
#change the current database to the one that you want to show tables: | |
\c testDb | |
# command from the PostgreSQL command prompt to show tables in the selected database: | |
# (+ :will add the size and description columns) | |
\dt+ | |
# show details of a specific table, you can specify the name of the table after the \d command: | |
\d+ table_name | |
#Query | |
SELECT * FROM table_name order by id desc limit 100; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment