psql: split examples, minor fixes
This commit is contained in:
@@ -2,18 +2,18 @@
|
||||
|
||||
> PostgreSQL command-line client
|
||||
|
||||
- Connect to database. It connects to localhost using default port *5432* with default user.
|
||||
- Connect to *database*. It connects to localhost using default port *5432* with default user
|
||||
|
||||
`psql {{database}}`
|
||||
|
||||
- Connect to database on given server host running on given port with username given
|
||||
- Connect to *database* on given server *host* running on given *port* with *username* given
|
||||
|
||||
`psql -h {{host}} -p {{port}} -U {{username}} mydb`
|
||||
`psql -h {{host}} -p {{port}} -U {{username}} {{database}}`
|
||||
|
||||
- Run query against the given database
|
||||
|
||||
`echo '{{query}}' | psql {{database}}`
|
||||
|
||||
or
|
||||
- Run single *query* against the given *database*. Note: useful in shell scripts
|
||||
|
||||
`psql -c '{{query}}' {{database}}`
|
||||
|
||||
- Run semicolon-separated *queries* against the given *database*. Note: useful in shell scripts
|
||||
|
||||
`echo '{{queries}}' | psql {{database}}`
|
Reference in New Issue
Block a user