Browse Source

psql: split examples, minor fixes

Igor Shubovych 11 years ago
parent
commit
82564bd222
1 changed files with 7 additions and 7 deletions
  1. 7 7
      pages/common/psql.md

+ 7 - 7
pages/common/psql.md

@@ -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
+- Run single *query* against the given *database*. Note: useful in shell scripts
 
-`echo '{{query}}' | psql {{database}}`
+`psql -c '{{query}}' {{database}}`
 
-or
+- Run semicolon-separated *queries* against the given *database*. Note: useful in shell scripts
 
-`psql -c '{{query}}' {{database}}`
+`echo '{{queries}}' | psql {{database}}`