From f04327d1c5aa82756b1dcdfc03cefd2e1de6ca44 Mon Sep 17 00:00:00 2001 From: Yonas Date: Fri, 23 Mar 2018 16:13:30 +0800 Subject: [PATCH 1/2] 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 From 7e1a7a98e251d48c1dcfb26f7d9ae2af0dc9bee8 Mon Sep 17 00:00:00 2001 From: Yonas Date: Fri, 23 Mar 2018 16:15:23 +0800 Subject: [PATCH 2/2] Fix placeholder description --- postgresql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgresql.md b/postgresql.md index 0dc485ff9..f82e829ad 100644 --- a/postgresql.md +++ b/postgresql.md @@ -2,7 +2,7 @@ title: PostgreSQL --- -Replace anything within accordingly +Replace anything within `` accordingly ### Console