"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Monday, February 17, 2020, Andre Lucas <andre@amazoniasistemas.com.br>
> 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