From 029aa97f2d90a2ef97b2c0ca917bea7268392eb1 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sat, 10 Aug 2002 16:57:32 +0000 Subject: Make sure all clients have the same understanding of default user name and database. In particular, make script wrappers understand the PGDATABASE environment variable. --- doc/src/sgml/ref/createdb.sgml | 18 ++++++++++++------ doc/src/sgml/ref/createlang.sgml | 5 ++--- doc/src/sgml/ref/createuser.sgml | 8 ++------ doc/src/sgml/ref/dropdb.sgml | 6 +----- doc/src/sgml/ref/droplang.sgml | 5 ++--- doc/src/sgml/ref/dropuser.sgml | 6 +----- doc/src/sgml/ref/pg_dump.sgml | 20 +++++++------------- doc/src/sgml/ref/pg_restore.sgml | 4 ++-- doc/src/sgml/ref/vacuumdb.sgml | 14 +++++++------- 9 files changed, 36 insertions(+), 50 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/createdb.sgml b/doc/src/sgml/ref/createdb.sgml index d0849388cd5..9e0de5572c3 100644 --- a/doc/src/sgml/ref/createdb.sgml +++ b/doc/src/sgml/ref/createdb.sgml @@ -1,5 +1,5 @@ @@ -237,6 +237,16 @@ PostgreSQL documentation Environment + + PGDATABASE + + + If set, the name of the database to create, unless overridden on + the command line. + + + + PGHOST PGPORT @@ -246,7 +256,7 @@ PostgreSQL documentation Default connection parameters. PGUSER also determines the name of the database to create, if it is not - specified in the command line. + specified on the command line or by PGDATABASE. @@ -257,7 +267,6 @@ PostgreSQL documentation Examples - To create the database demo using the default database server: @@ -268,9 +277,7 @@ PostgreSQL documentation The response is the same as you would have gotten from running the CREATE DATABASE SQL command. - - To create the database demo using the server on host eden, port 5000, using the @@ -282,7 +289,6 @@ PostgreSQL documentation CREATE DATABASE - diff --git a/doc/src/sgml/ref/createlang.sgml b/doc/src/sgml/ref/createlang.sgml index 7ad26ae82e9..b454374deb2 100644 --- a/doc/src/sgml/ref/createlang.sgml +++ b/doc/src/sgml/ref/createlang.sgml @@ -1,5 +1,5 @@ @@ -168,6 +168,7 @@ PostgreSQL documentation + PGDATABASE PGHOST PGPORT PGUSER @@ -214,7 +215,6 @@ PostgreSQL documentation Examples - To install pltcl into the database template1: @@ -222,7 +222,6 @@ PostgreSQL documentation $ createlang pltcl template1 - diff --git a/doc/src/sgml/ref/createuser.sgml b/doc/src/sgml/ref/createuser.sgml index d4be6e7b25d..1576062aff0 100644 --- a/doc/src/sgml/ref/createuser.sgml +++ b/doc/src/sgml/ref/createuser.sgml @@ -1,5 +1,5 @@ @@ -128,7 +128,7 @@ PostgreSQL documentation The new user is allowed to create other users. - (Note: actually, this makes the new user a superuser. + (Note: Actually, this makes the new user a superuser. The option is poorly named.) @@ -264,7 +264,6 @@ PostgreSQL documentation Examples - To create a user joe on the default database server: @@ -275,9 +274,7 @@ PostgreSQL documentation CREATE USER - - To create the same user joe using the server on host eden, port 5000, avoiding the prompts and @@ -288,7 +285,6 @@ PostgreSQL documentation CREATE USER - diff --git a/doc/src/sgml/ref/dropdb.sgml b/doc/src/sgml/ref/dropdb.sgml index e2fd2e3eccf..aaecbf821ce 100644 --- a/doc/src/sgml/ref/dropdb.sgml +++ b/doc/src/sgml/ref/dropdb.sgml @@ -1,5 +1,5 @@ @@ -191,7 +191,6 @@ PostgreSQL documentation Examples - To destroy the database demo on the default database server: @@ -200,9 +199,7 @@ PostgreSQL documentation DROP DATABASE - - To destroy the database demo using the server on host eden, port 5000, with verification and a peek @@ -215,7 +212,6 @@ Are you sure? (y/n) y DROP DATABASE - diff --git a/doc/src/sgml/ref/droplang.sgml b/doc/src/sgml/ref/droplang.sgml index 186af6e2a09..d6f14cfbcae 100644 --- a/doc/src/sgml/ref/droplang.sgml +++ b/doc/src/sgml/ref/droplang.sgml @@ -1,5 +1,5 @@ @@ -157,6 +157,7 @@ PostgreSQL documentation + PGDATABASE PGHOST PGPORT PGUSER @@ -196,14 +197,12 @@ PostgreSQL documentation Examples - To remove pltcl: $ droplang pltcl dbname - diff --git a/doc/src/sgml/ref/dropuser.sgml b/doc/src/sgml/ref/dropuser.sgml index 5d45347ee1c..9fdd3c72d3b 100644 --- a/doc/src/sgml/ref/dropuser.sgml +++ b/doc/src/sgml/ref/dropuser.sgml @@ -1,5 +1,5 @@ @@ -181,7 +181,6 @@ PostgreSQL documentation Examples - To remove user joe from the default database server: @@ -190,9 +189,7 @@ PostgreSQL documentation DROP USER - - To remove user joe using the postmaster on host eden, port 5000, with verification and a peek at the underlying @@ -205,7 +202,6 @@ Are you sure? (y/n) y DROP USER - diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index 7969489f11c..2f5085a52d5 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -1,5 +1,5 @@ @@ -43,7 +43,7 @@ PostgreSQL documentation -p port -U username -W - dbname + dbname @@ -126,7 +126,10 @@ PostgreSQL documentation dbname - Specifies the name of the database to be dumped. + Specifies the name of the database to be dumped. If this is + not specified, the environment variable + PGDATABASE is used. If that is not set, the + user name specified for the connection is used. @@ -562,7 +565,7 @@ PostgreSQL documentation - Connect as the given user. + Connect as the given user @@ -588,15 +591,6 @@ PostgreSQL documentation PGDATABASE - - - - Database to dump, unless overridden on the command line. - - - - - PGHOST PGPORT PGUSER diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml index e89d76bbc1b..7f5432fc7ae 100644 --- a/doc/src/sgml/ref/pg_restore.sgml +++ b/doc/src/sgml/ref/pg_restore.sgml @@ -1,4 +1,4 @@ - + @@ -475,7 +475,7 @@ - Connect as the given user. + Connect as the given user diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml index 37debc1b845..f29eabce1b4 100644 --- a/doc/src/sgml/ref/vacuumdb.sgml +++ b/doc/src/sgml/ref/vacuumdb.sgml @@ -1,5 +1,5 @@ @@ -75,6 +75,11 @@ PostgreSQL documentation Specifies the name of the database to be cleaned or analyzed. + If this is not specified and (or + ) is not used, the database name is read + from the environment variable PGDATABASE. If + that is not set, the user name specified for the connection is + used. @@ -251,6 +256,7 @@ PostgreSQL documentation + PGDATABASE PGHOST PGPORT PGUSER @@ -268,16 +274,13 @@ PostgreSQL documentation Examples - To clean the database test: $ vacuumdb test - - To clean and analyze for the optimizer a database named bigdb: @@ -285,9 +288,7 @@ PostgreSQL documentation $ vacuumdb --analyze bigdb - - To clean a single table foo in a database named @@ -297,7 +298,6 @@ PostgreSQL documentation $ vacuumdb --analyze --verbose --table 'foo(bar)' xyzzy - -- cgit v1.2.3