Merge pull request #470 from yonasstephen/master
Add more psql commands
This commit is contained in:
commit
f6a0140e1d
|
@ -2,15 +2,21 @@
|
||||||
title: PostgreSQL
|
title: PostgreSQL
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Replace anything within `<placeholder>` accordingly
|
||||||
|
|
||||||
### Console
|
### Console
|
||||||
|
|
||||||
$ psql
|
$ psql #logs in to default database & default user
|
||||||
|
$ sudo -u <rolename:postgres> psql #logs in with a particular user
|
||||||
|
|
||||||
### Commands
|
### Commands
|
||||||
|
|
||||||
|
* Show roles: `\du`
|
||||||
* Show tables: `\dt`
|
* Show tables: `\dt`
|
||||||
* Show databases: `\l`
|
* Show databases: `\l`
|
||||||
* Show columns of a table: `\d table` or `\d+ table`
|
* Connect to a database: `\c <database>`
|
||||||
|
* Show columns of a table: `\d <table>` or `\d+ <table>`
|
||||||
|
* Quit: `\q`
|
||||||
|
|
||||||
### Creating database
|
### Creating database
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue