src/port/getopt_long.c lossy with arguments having no option characters - Mailing list pgsql-bugs

From Michael Paquier
Subject src/port/getopt_long.c lossy with arguments having no option characters
Date
Msg-id CAB7nPqQ45JbD1ZBvbD7gqQK4diGZXmGw56zp7R_DvEKO8EdMbQ@mail.gmail.com
Whole thread Raw
Responses Re: src/port/getopt_long.c lossy with arguments having no option characters  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Hi all,

The implementation of getopt_long in src/port has some limitations,
for example such commands do not work but they should:
$ createdb foobar3 -E win1252
createdb: too many command-line arguments (first is "win1252")
Try "createdb --help" for more information.
$ initdb pgdata --noclean
initdb: too many command-line arguments (first is "--noclean")
Try "initdb --help" for more information.

And those ones work:
createdb -E win1252 foobar3
initdb --noclean pgdata

I bumped into this problem when running the TAP tests on Windows, but
I guess that it easy to reproduce it with any builds of Postgres on
Windows as getopt_long is used unconditionally, on any version, for
all commands. Or on any platform that has not getopt_long, if any
exists.
Regards,
--
Michael

pgsql-bugs by date:

Previous
From: John R Pierce
Date:
Subject: Re: BUG #12939: GRANT ALL ON ALL SEQUENCES doesn't work for sequences not yet existing
Next
From: Ilya Bazylchuk
Date:
Subject: Postgresql 9.4.1 stuck all queries when making multi updates