From 82564bd2220bc0d3fe4703eb137c025bde33fb47 Mon Sep 17 00:00:00 2001 From: Igor Shubovych Date: Mon, 12 May 2014 14:44:31 +0300 Subject: [PATCH] psql: split examples, minor fixes --- pages/common/psql.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pages/common/psql.md b/pages/common/psql.md index 85b24c9af5..45ed18ac65 100644 --- a/pages/common/psql.md +++ b/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 - -`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}}` \ No newline at end of file