mirror of https://github.com/CrimsonTome/tldr.git
psql: split examples, minor fixes
parent
77be8f37bf
commit
82564bd222
|
@ -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}}`
|
Loading…
Reference in New Issue