From andre@amazoniasistemas.com.br Mon Feb 17 20:38:34 2020 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3t45-0000w3-HL for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Feb 2020 02:56:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j3t44-0003t3-93 for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Feb 2020 02:56:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3nAC-0000ck-CW for pgsql-bugs@lists.postgresql.org; Mon, 17 Feb 2020 20:38:44 +0000 Received: from hm1831-38.locaweb.com.br ([189.126.112.58]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1j3nA7-000114-Vx for pgsql-bugs@postgresql.org; Mon, 17 Feb 2020 20:38:41 +0000 Received: from mcbain0014.correio.biz (189.126.112.17) by hm1831-n-113.locaweb.com.br id h9bsrm15ctof for ; Mon, 17 Feb 2020 17:38:14 -0300 (envelope-from ) Received: from proxy.email-ssl.com.br (bartf0034.email.locaweb.com.br [10.31.120.66]) by mcbain0014.correio.biz (Postfix) with ESMTP id D57C63803B6 for ; Mon, 17 Feb 2020 17:37:46 -0300 (-03) x-locaweb-id: HscCca6RSl7vXuM6KmCZPz88gf4KgYnVNCXFZxXw2dtEoy8ZnJC_eQhOQoRAMSmxJPhQxS-IdhhVjri-_A6xlmgiggJ1CJpbaM1maOqp6M0Zh4e5YhNa9jMoJG4HjVkyfoQ5M-svQrzAdRdtcETxiHnu0l0UYRMkwrvKamA7wLUSm85PKJreFQ625H27A885Rez7W5ealwUoyZd6ptOHacipUVCCZDcCa9oeK3DWzQo= NjE2ZTY0NzI2NTZjNzU2MzYxNzM0MDYxNmQ2MTdhNmY2ZTY5NjE3MzY5NzM3NDY1NmQ2MTczMmU2MzZmNmQyZTYyNzI= X-LocaWeb-COR: locaweb_2009_x-mail X-AuthUser: andrelucas@amazoniasistemas.com.br Received: from [IPv6:::ffff:192.168.220.132] (unknown [200.11.13.114]) (Authenticated sender: andrelucas@amazoniasistemas.com.br) by proxy.email-ssl.com.br (Postfix) with ESMTPSA id 2D6937A0211 for ; Mon, 17 Feb 2020 17:38:34 -0300 (-03) MIME-Version: 1.0 To: "pgsql-bugs@postgresql.org" From: Andre Lucas Subject: PSQL Help Date: Mon, 17 Feb 2020 16:38:34 -0400 Importance: normal X-Priority: 3 Content-Type: multipart/alternative; boundary="_2EB969BF-C3B3-49E6-AC6D-E2A80EED902F_" Message-Id: <20200217203834.2D6937A0211@proxy.email-ssl.com.br> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_2EB969BF-C3B3-49E6-AC6D-E2A80EED902F_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" I am having the following problem when trying to restore a backup of a foll= owing file. the version of postGre on my machine is 9.3 However, the backup was made in version 9.2.15 I get the following message when I try to run psql: psql -h localhost -U postgres NovoBD -f Backup17.sql =E2=80=9Cpsql: warning: extra command-line argument "-f" ignored psql: warning: extra command-line argument "Backup17.sql" ignored psql (9.3.21)=E2=80=9D --_2EB969BF-C3B3-49E6-AC6D-E2A80EED902F_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

I am having the following problem wh= en trying to restore a backup of a following file.

=  

the version of postGre on my mach= ine is 9.3

 

However, the backup was made in version 9.2.15

 

I get the following message when I = try to run psql:

 

psql -h localhost -U postgres NovoBD -f Backup17.sql

 

 

 

=E2=80=9Cpsql:= warning: extra command-line argument "-f" ignored

psql: warning: extra command-line argument "Backup17.sql&quo= t; ignored

psql (9.3.21)=E2=80=9D

= --_2EB969BF-C3B3-49E6-AC6D-E2A80EED902F_-- From david.g.johnston@gmail.com Tue Feb 18 03:06:13 2020 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3tDH-0001KY-Ie for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Feb 2020 03:06:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j3tDG-00012n-7q for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Feb 2020 03:06:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3tDF-00012g-Sg for pgsql-bugs@lists.postgresql.org; Tue, 18 Feb 2020 03:06:18 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j3tDD-000429-KT for pgsql-bugs@postgresql.org; Tue, 18 Feb 2020 03:06:16 +0000 Received: by mail-qt1-x844.google.com with SMTP id c5so13523581qtj.6 for ; Mon, 17 Feb 2020 19:06:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=i5/YszyFZa6fabCZD+zChR3zvD5c7Cga1qulXZlmevw=; b=tcCvmiaGcRSyCyz6L3X0csK7rU/qM9MOy4X7GD9fCjy3EE0oJKTn0fI4ppew0jR/wb LlVWuM9rdlfSK4S23ovvi4DaiJDcpaDDnphnDW0ymh8QuHtwlCp8PsefPxqB6MYvbr4Z +JyvITCjHYWNHRYt6IO45jEmBREaMlmbBxfzDVgPSpPxY1FaEGVDnaayHlyLXJpTdYkz CumFyxcgySfSDIhMYJIlOCUgyWDfIrizwrVY5Zxs7oeCb5kiUNo0PR/2on+1sCLHBrCf lvNWJIgk944ewW1O4xLHeAKfKnU4nCuIDfGCujntKT8drZW2boI72P9FJREpD7fyFyHo K4Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=i5/YszyFZa6fabCZD+zChR3zvD5c7Cga1qulXZlmevw=; b=Mt7fZmytTaJQVvUReyQQlnMDr1ap0lwrr8ioWpyWcGSRuXL/9/zehH0+stvLjLPP24 A4k9826pEfZz4117eP3smqnDsul+AMRcuKps5/LbSY+uSkj1sMWAaqKY48sa1sQAo+zR w/2hjDbIj+iU4QntdYCM+l5Y24zrLXsqcAdnv2JRdMY7uvb+AXwelSH6x11cSX1YTnwu UCpzgbx+ZkkGREFsuqi9Gli0sfNIK97axVNAAnUq7s2EaNhgsa0hR+sRM/H3QRI6ILnh 2UfHvfJbl0EOIA3SGUdN5c407g7jqlyiBAD4FIP8mjtmQ1CfhJ5lkAHerdymHgXMnOoq ac6g== X-Gm-Message-State: APjAAAXz44OcCNi/BLMSW9sEYXLqfxpDR91p3dwIATYJ2Wu46gOwhCoE 8NCeDwm/ia6Z7iqrlXAD9df4Q34HVJYbcHgVg0tk2w== X-Google-Smtp-Source: APXvYqwdA2pCY5CH1+nZi0WhHVIVHFGNrwNmuiJ9w7MK8CIJ+vhp8SZGIQur/5NOdYZe6ZjYBF9iCbCrjN+tQ0RcxZg= X-Received: by 2002:ac8:198c:: with SMTP id u12mr15931844qtj.225.1581995174537; Mon, 17 Feb 2020 19:06:14 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a0c:eb89:0:0:0:0:0 with HTTP; Mon, 17 Feb 2020 19:06:13 -0800 (PST) In-Reply-To: <20200217203834.2D6937A0211@proxy.email-ssl.com.br> References: <20200217203834.2D6937A0211@proxy.email-ssl.com.br> From: "David G. Johnston" Date: Mon, 17 Feb 2020 20:06:13 -0700 Message-ID: Subject: Re: PSQL Help To: Andre Lucas Cc: "pgsql-bugs@postgresql.org" Content-Type: multipart/alternative; boundary="0000000000006a2fa8059ed0f4db" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000006a2fa8059ed0f4db Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, February 17, 2020, Andre Lucas wrote: > > psql -h localhost -U postgres NovoBD -f Backup17.sql > > =E2=80=9Cpsql: warning: extra command-line argument "-f" ignored > > psql: warning: extra command-line argument "Backup17.sql" ignored > You command doesn=E2=80=99t match the documented syntax: psql [option...] [dbname [username]] Hint: NovoBD is the =E2=80=9Cdbname=E2=80=9D David J. --0000000000006a2fa8059ed0f4db Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, February 17, 2020, Andre Lucas <andre@amazoniasistemas.com.br> wrote:

psql -h localhost -U postgres NovoBD -f Backup17.sql

=E2=80=9Cpsql: warning: extra command-line argument= "-f" ignored

psql: warning: extra comm= and-line argument "Backup17.sql" ignored


You command doesn=E2=80=99t match the documented syntax:<= /div>

=C2=A0psql=C2=A0[option= ...] [dbname=C2=A0[username]]
Hint: NovoBD is the= =E2=80=9Cdbname=E2=80=9D

David J.

--0000000000006a2fa8059ed0f4db-- From tgl@sss.pgh.pa.us Tue Feb 18 03:39:16 2020 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3tjT-0002DC-AB for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Feb 2020 03:39:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j3tjR-0006Qo-Ud for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Feb 2020 03:39:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3tjR-0006PY-J0 for pgsql-bugs@lists.postgresql.org; Tue, 18 Feb 2020 03:39:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j3tjL-0004HA-2y for pgsql-bugs@postgresql.org; Tue, 18 Feb 2020 03:39:32 +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 01I3dGZL032737; Mon, 17 Feb 2020 22:39:16 -0500 From: Tom Lane To: "David G. Johnston" cc: Andre Lucas , "pgsql-bugs@postgresql.org" Subject: Re: PSQL Help In-reply-to: References: <20200217203834.2D6937A0211@proxy.email-ssl.com.br> Comments: In-reply-to "David G. Johnston" message dated "Mon, 17 Feb 2020 20:06:13 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <32735.1581997156.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 17 Feb 2020 22:39:16 -0500 Message-ID: <32736.1581997156@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > On Monday, February 17, 2020, Andre Lucas > wrote: >> psql -h localhost -U postgres NovoBD -f Backup17.sql >> “psql: warning: extra command-line argument "-f" ignored >> psql: warning: extra command-line argument "Backup17.sql" ignored > You command doesn’t match the documented syntax: > psql [option...] [dbname [username]] > Hint: NovoBD is the “dbname” FWIW, Andres' example *will* work on some platforms, because glibc's getopt_long() takes it upon itself to rearrange the arguments. But it doesn't work everywhere, which is why we only document/recommend the stricter argument order. regards, tom lane From michael@paquier.xyz Tue Feb 18 04:37:37 2020 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3udz-0003vD-6M for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Feb 2020 04:37:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j3udx-00039A-SR for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Feb 2020 04:37:57 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3udx-00038Z-K7 for pgsql-bugs@lists.postgresql.org; Tue, 18 Feb 2020 04:37:57 +0000 Received: from [66.111.4.25] (helo=out1-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j3udv-0006WZ-2g for pgsql-bugs@postgresql.org; Tue, 18 Feb 2020 04:37:57 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9FB4521FFC; Mon, 17 Feb 2020 23:37:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 17 Feb 2020 23:37:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=WrpX9KB8TUU6iyPcyiaiVczSi0W rgy+EkzVrbkcReBs=; b=ROERXq0zHCvLK2Lkk8oiVNptV+jHzxcXs/VQ0Fc+4M8 WKAZGjFOixQtyaIKak6bwXMyo7cM+PbUYx6c20dpcVMwdn2r+6GBxF/ftj8KZ0iy N6X74BRtWXvOALuOZfSQW/GrI4JuWRhewXMXY+Tz27dOVXoCKPBzZYQn/TjQOtfX rAtZm+uUaHQyuq8QBsd0i0i6tCoj4Ik41+bzugsdPZ6zvhvsC2P193eDAZ/bAmqH 0Dv+M0YC5c0EddpE2fR25w8gx2IWMZOwLxJP6NROMNt7z6eN/wMswZScAEIExa5M IzvgqaOCVTXAEjh1ly+4kXJlXtd5KiYfxj/6lP10aLw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=WrpX9K B8TUU6iyPcyiaiVczSi0Wrgy+EkzVrbkcReBs=; b=so//r6OSCAnkMeT0YaAj0/ CXr6IzA1JUr60NqsMbawoJc3jIocDS2x23VgbBkWEs0ZUuYZttP0LYJwjl9J142p ozEgvbt7Yav2E3mqu3Quzp6dcyNcN0RsqefiVylE0Anp/AiTpK7vGaNGYkiMeA2v Em54o1AFoxyy/0jGWXq2Ix/u4b9NLtCpgqUdN5Evvfg2ao2C6HZ1l4Ux2oPaHARn bQgTb7+xztWvZIGDQo0nDZXAiXBg13YICeSxs+XzG8YB0eYA1t032v16DV8RWY7E O4qHvwdKsReNPTCEJT1CxeinrSdN5/vKEUiUBR9cfV6z05l+xdIy7Jvfz6rKsAKA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjeejgdejvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecukfhppeduuddurddutddvrddukedtrddukeehnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesph grqhhuihgvrhdrgiihii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 67CD6328005A; Mon, 17 Feb 2020 23:37:41 -0500 (EST) Date: Tue, 18 Feb 2020 13:37:37 +0900 From: Michael Paquier To: Tom Lane Cc: "David G. Johnston" , Andre Lucas , "pgsql-bugs@postgresql.org" Subject: Re: PSQL Help Message-ID: <20200218043737.GG4176@paquier.xyz> References: <20200217203834.2D6937A0211@proxy.email-ssl.com.br> <32736.1581997156@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tctmm6wHVGT/P6vA" Content-Disposition: inline In-Reply-To: <32736.1581997156@sss.pgh.pa.us> X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.25 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --tctmm6wHVGT/P6vA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Feb 17, 2020 at 10:39:16PM -0500, Tom Lane wrote: > FWIW, Andres' example *will* work on some platforms, because glibc's > getopt_long() takes it upon itself to rearrange the arguments. > But it doesn't work everywhere, which is why we only document/recommend > the stricter argument order. This is actually the case of our fallback implementation used for example on Windows with MSVC builds. This led to fixes in our regression tests like c67a86f, so we avoid this style as much as possible on portability's ground. -- Michael --tctmm6wHVGT/P6vA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl5LahEACgkQnvQgOdby QH3OQQ/8Cjw7VfN7BAiiYQ0Wz59YpPhdq4Ggi55wQrsRpuTfhwgh7nf+Dnr4NYJ8 ZCnXgDC93v7jeleprAyELiRwb8R5wDM+ilBxEAiVdH8UL1rKZ1cdb5JzBTY5ngSf oYwEfz7sNJC2ndiGJph//yYyoKOX+B4d/fZtebzPdo5gilfAuOP9MiuHtVO8MGdp bXXvkByu25TNHNf8bm6H14X0oqKTAjMevljTkdPtfHciO2QglszVGQX+RxnY4WiM FxnFSfeENLE4kWq+Ub/HM1LZD3odUkssZRVYP++XhBT6hB0inLhXaCQyE5APhm5K QykksvBL0WTH1IvgsKOnmuL3CyMT91p05gU5gpQWeZv4Kew6QTn9qHx2YaGCA4k8 a5JmSFDJjXVJav+pxBocgWvhORXgqgZZpFJXvM9i9eHNGVPVNfgvOtLi/eO52pnX 7eT5P2UI+UT29ZXsEdZMPqVnExcHrYbB2+mfOou5wgNuwud5yvwH0yO1Om0hc9gh fWMHsVDDvRKWvuyudASR+2vSLfWYaE1pXykRhEURC4v6KrDUXglmKYq4oFsK1+yT amUSdler/LNprz+1y13uEkRFCoXrSw9mofi34Hi3fdaYfqIAvqm/kCJ6NGoH5KV8 9mskMLiKB4C4eqFLyS8U0wUwWVoAxNV0YNMWF4679vEMJTm7f0A= =Mz6r -----END PGP SIGNATURE----- --tctmm6wHVGT/P6vA--