pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_restore documentation
3+ messages / 3 participants
[nested] [flat]

* pg_restore documentation
@ 2017-06-26 19:36 wkhatch@me.com
  2017-06-28 18:39 ` Re: pg_restore documentation David G. Johnston <david.g.johnston@gmail.com>
  2017-06-28 18:46 ` Re: pg_restore documentation Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 3+ messages in thread

From: wkhatch@me.com @ 2017-06-26 19:36 UTC (permalink / raw)
  To: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.2/static/app-pgrestore.html
Description:

Following docs, I&#39;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 &quot;yeahRight&quot;)


I would absolutely expect this to at least initiate, and not fail due to
command syntax issues. I feel this documentation is lacking, as there are no
examples for using multiple arguments and options, and it does not appear to
work the way a typical shell utility would work

-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pg_restore documentation
  2017-06-26 19:36 pg_restore documentation wkhatch@me.com
@ 2017-06-28 18:39 ` David G. Johnston <david.g.johnston@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: David G. Johnston @ 2017-06-28 18:39 UTC (permalink / raw)
  To: wkhatch@me.com <wkhatch@me.com>; +Cc: pgsql-docs

On Monday, June 26, 2017, <wkhatch@me.com> wrote:
>
> 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
> &quot;yeahRight&quot;)
>

All -W does is force a prompt.  There is no way to actually supply the
password on the command line, that is what environment variables or pgpass
are for.

David J.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pg_restore documentation
  2017-06-26 19:36 pg_restore documentation wkhatch@me.com
@ 2017-06-28 18:46 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2017-06-28 18:46 UTC (permalink / raw)
  To: wkhatch@me.com; +Cc: pgsql-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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2017-06-28 18:46 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-06-26 19:36 pg_restore documentation wkhatch@me.com
2017-06-28 18:39 ` David G. Johnston <david.g.johnston@gmail.com>
2017-06-28 18:46 ` Tom Lane <tgl@sss.pgh.pa.us>

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