commands | description |
---|---|
GRANT ALL PRIVILEGES ON DATABASE <<nama database>> TO <<nama user>>; |
Query to grant All Previledges to a user |
sudo -u postgres psql |
Linux ubuntu login to superadmin |
CREATE USER <<nama user>> WITH ENCRYPTED PASSWORD '<<password>>'; |
Query to create user |
\l |
get database list in the postgres server |
\c database_name |
connect to a database (You need to connect to a database first before you can run the below commands) |
\d table_name |
show table details |
\dt |
show table list in the schema |
\dt+ |
List all tables details with detailed information |
Row5 | |
Row6 | |
Row7 | |
Row8 | |
Row9 | |
Row10 |
Last active
October 2, 2023 09:51
-
-
Save ryumada/bd03aaed0c32deb54fea1e1d73f1ddce to your computer and use it in GitHub Desktop.
basic psql commands cheatsheet PostgreSQL
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment