From: Tom Lane <tgl@sss.pgh.pa.us>
To: wkhatch@me.com
Cc: pgsql-docs@postgresql.org
Subject: Re: pg_restore documentation
Date: Wed, 28 Jun 2017 14:46:18 -0400
Message-ID: <1037.1498675578@sss.pgh.pa.us> (raw)
In-Reply-To: <20170626193653.17677.95501@wrigleys.postgresql.org>
References: <20170626193653.17677.95501@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-docs>
wkhatch@me.com writes:
> Following docs, I'm having an unexpected failure when I issue this format of
> the command:
> pg_restore drupal_dump.sql -h
> adjh4syhpk555s.cckxxqjsrxhd.us-east-1.rds.amazonaws.com -U someUser -W
> yeahRight -d wm_drupal
> I get error:
> pg_restore: too many command-line arguments (first is "yeahRight")
> I would absolutely expect this to at least initiate, and not fail due to
> command syntax issues.
The -W option is clearly documented as not taking any parameter, so
I'm unclear on why you feel that this command doesn't have syntax issues.
> I feel this documentation is lacking, as there are no
> examples for using multiple arguments and options,
Did you read down to the "Examples" section?
> and it does not appear to
> work the way a typical shell utility would work
AFAIK, this behavior is extremely common, because it's using the standard
getopt_long() library function to parse the arguments.
The fact that you can write the dump file name first, rather than after
the switch options as documented, is because your platform supplies a
version of getopt_long() that will allow that. We don't document that
because it wouldn't work everywhere; the syntax depicted in the manual is
what we consider supported. We could force the issue by refusing to use
the platform's getopt_long(), but then we'd act less like other shell
utilities which do use it.
regards, tom lane
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: tgl@sss.pgh.pa.us, wkhatch@me.com
Subject: Re: pg_restore documentation
In-Reply-To: <1037.1498675578@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox