From f04327d1c5aa82756b1dcdfc03cefd2e1de6ca44 Mon Sep 17 00:00:00 2001 From: Yonas Date: Fri, 23 Mar 2018 16:13:30 +0800 Subject: [PATCH] Add more basic psql commands --- postgresql.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/postgresql.md b/postgresql.md index 3b5699ed3..0dc485ff9 100644 --- a/postgresql.md +++ b/postgresql.md @@ -2,15 +2,21 @@ title: PostgreSQL --- +Replace anything within accordingly + ### Console - $ psql + $ psql #logs in to default database & default user + $ sudo -u psql #logs in with a particular user ### Commands + * Show roles: `\du` * Show tables: `\dt` * Show databases: `\l` - * Show columns of a table: `\d table` or `\d+ table` + * Connect to a database: `\c ` + * Show columns of a table: `\d ` or `\d+
` + * Quit: `\q` ### Creating database