psql: split examples, minor fixes

This commit is contained in:
Igor Shubovych 2014-05-12 14:44:31 +03:00
parent 77be8f37bf
commit 82564bd222

View File

@ -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}}`