From f000ffd28ec815c4f0aff0f7daffe9a5693a9648 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 17 May 2001 21:12:49 +0000 Subject: Add -U and -W options to pg_dump and friends to support non-interactive specification of username (like in psql). pg_dumpall now works with password authentication. --- doc/src/sgml/backup.sgml | 25 +++++-------------------- doc/src/sgml/ref/pg_dump.sgml | 22 +++++++++++++++------- doc/src/sgml/ref/pg_dumpall.sgml | 32 ++++++++++++++++++++++++++------ doc/src/sgml/ref/pg_restore.sgml | 19 +++++++++++++++---- 4 files changed, 61 insertions(+), 37 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index 160cb0bba1b..ba1b6c9b21c 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1,4 +1,4 @@ - + Backup and Restore @@ -61,11 +61,10 @@ pg_dump dbname > Postgres client application, pg_dump will by default connect with the database user name that is equal to the current Unix user name. To override - this, either specify the option to force a prompt for - the user name, or set the environment variable - PGUSER. Remember that pg_dump - connections are subject to the normal client authentication - mechanisms (which are described in -U option or set the + environment variable PGUSER. Remember that + pg_dump connections are subject to the normal + client authentication mechanisms (which are described in ). @@ -163,20 +162,6 @@ pg_dumpall > outfile you have database superuser access, as that is required to restore the user and group information. - - - pg_dumpall has one little flaw: It is - not prepared for interactively authenticating to each database it - dumps. If you are using password authentication then you need to - set it the environment variable PGPASSWORD to - communicate the password the the underlying calls to - pg_dump. More severely, if you have different - passwords set up for each database, then - pg_dumpall will fail. You can either choose a - different authentication mechanism for the purposes of backup or - adjust the pg_dumpall shell script to your - needs. - diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index ddcf5db63f8..be2afefc8f2 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -1,5 +1,5 @@ @@ -46,7 +46,8 @@ Postgres documentation -Z 0...9 -h host -p port - -u + -U username + -W dbname @@ -412,13 +413,20 @@ Postgres documentation - -u + -U username - Use password authentication. - Prompts for - username - and password. + Connect as the given user. + + + + + + -W + + + Force a password prompt. This should happen automatically if + the server requires password authentication. diff --git a/doc/src/sgml/ref/pg_dumpall.sgml b/doc/src/sgml/ref/pg_dumpall.sgml index aa2c2a88276..bf35106c67a 100644 --- a/doc/src/sgml/ref/pg_dumpall.sgml +++ b/doc/src/sgml/ref/pg_dumpall.sgml @@ -1,5 +1,5 @@ @@ -23,9 +23,11 @@ Postgres documentation pg_dumpall -c--clean + -g--globals-only -h host -p port - -g--globals-only + -U username + -W @@ -81,6 +83,15 @@ Postgres documentation + + -g, --globals-only + + + Only dump global objects (users and groups), no databases. + + + + -h host @@ -106,14 +117,23 @@ Postgres documentation - -g, --globals-only + -U username - Only dump global objects (users and groups), no databases. + Connect as the given user. + + -W + + + Force a password prompt. This should happen automatically if + the server requires password authentication. + + + @@ -128,8 +148,8 @@ Postgres documentation - - Usage + + Examples To dump all databases: diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml index 246154a8df2..5ab98fc0b3a 100644 --- a/doc/src/sgml/ref/pg_restore.sgml +++ b/doc/src/sgml/ref/pg_restore.sgml @@ -1,4 +1,4 @@ - + @@ -46,7 +46,8 @@ -x -h host -p port - -u + -U username + -W archive-file @@ -448,10 +449,20 @@ - -u + -U username - Use password authentication. Prompts for user name and password. + Connect as the given user. + + + + + + -W + + + Force a password prompt. This should happen automatically if + the server requires password authentication. -- cgit v1.2.3