Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQHzF-0004MH-4M for pgsql-docs@arkaria.postgresql.org; Wed, 28 Jun 2017 18:46:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dQHzE-0002zt-5K for pgsql-docs@arkaria.postgresql.org; Wed, 28 Jun 2017 18:46:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dQHyr-0002L8-6T for pgsql-docs@postgresql.org; Wed, 28 Jun 2017 18:46:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dQHyo-0003ao-I6 for pgsql-docs@postgresql.org; Wed, 28 Jun 2017 18:46:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v5SIkIsx001038; Wed, 28 Jun 2017 14:46:18 -0400 From: Tom Lane To: wkhatch@me.com cc: pgsql-docs@postgresql.org Subject: Re: pg_restore documentation In-reply-to: <20170626193653.17677.95501@wrigleys.postgresql.org> References: <20170626193653.17677.95501@wrigleys.postgresql.org> Comments: In-reply-to wkhatch@me.com message dated "Mon, 26 Jun 2017 19:36:53 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1036.1498675578.1@sss.pgh.pa.us> Date: Wed, 28 Jun 2017 14:46:18 -0400 Message-ID: <1037.1498675578@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org 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