agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Fix option argument lookup in in-tree getopt_long().
4+ messages / 1 participants
[nested] [flat]

* pgsql: Fix option argument lookup in in-tree getopt_long().
@ 2026-09-11 20:20 Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Nathan Bossart @ 2026-09-11 20:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix option argument lookup in in-tree getopt_long().

The in-tree getopt_long() moves each non-option to the end of argv,
which might put it right where an option's argument lookup expects
to find the argument.  For example, "vacuumdb postgres --jobs"
takes "postgres" as the number of jobs instead of complaining that
--jobs is missing its argument.  To fix, stop the argument lookups
at the start of the moved non-options, which we already track to
know when to stop scanning.

Oversight in commit 411b720343.

Author: Sehrope Sarkuni <sehrope@jackdb.com>
Reviewed-by: solai v <solai.cdac@gmail.com>
Discussion: https://postgr.es/m/CAH7T-arxDuVCSkorO%3Dk7%2BM-_JV0JFzMpN_EtKMyD2K0RDqZ2OA%40mail.gmail.com
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/237176b7951539fcc54f6a81ce1f29853099c3f7

Modified Files
--------------
src/bin/scripts/t/100_vacuumdb.pl |  4 ++++
src/port/getopt_long.c            | 14 +++++++-------
2 files changed, 11 insertions(+), 7 deletions(-)



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

* pgsql: Fix option argument lookup in in-tree getopt_long().
@ 2026-09-11 20:20 Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Nathan Bossart @ 2026-09-11 20:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix option argument lookup in in-tree getopt_long().

The in-tree getopt_long() moves each non-option to the end of argv,
which might put it right where an option's argument lookup expects
to find the argument.  For example, "vacuumdb postgres --jobs"
takes "postgres" as the number of jobs instead of complaining that
--jobs is missing its argument.  To fix, stop the argument lookups
at the start of the moved non-options, which we already track to
know when to stop scanning.

Oversight in commit 411b720343.

Author: Sehrope Sarkuni <sehrope@jackdb.com>
Reviewed-by: solai v <solai.cdac@gmail.com>
Discussion: https://postgr.es/m/CAH7T-arxDuVCSkorO%3Dk7%2BM-_JV0JFzMpN_EtKMyD2K0RDqZ2OA%40mail.gmail.com
Backpatch-through: 17

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a160883053c3712af14c3035c7a1d5462a836a89

Modified Files
--------------
src/bin/scripts/t/100_vacuumdb.pl |  4 ++++
src/port/getopt_long.c            | 14 +++++++-------
2 files changed, 11 insertions(+), 7 deletions(-)



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

* pgsql: Fix option argument lookup in in-tree getopt_long().
@ 2026-09-11 20:20 Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Nathan Bossart @ 2026-09-11 20:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix option argument lookup in in-tree getopt_long().

The in-tree getopt_long() moves each non-option to the end of argv,
which might put it right where an option's argument lookup expects
to find the argument.  For example, "vacuumdb postgres --jobs"
takes "postgres" as the number of jobs instead of complaining that
--jobs is missing its argument.  To fix, stop the argument lookups
at the start of the moved non-options, which we already track to
know when to stop scanning.

Oversight in commit 411b720343.

Author: Sehrope Sarkuni <sehrope@jackdb.com>
Reviewed-by: solai v <solai.cdac@gmail.com>
Discussion: https://postgr.es/m/CAH7T-arxDuVCSkorO%3Dk7%2BM-_JV0JFzMpN_EtKMyD2K0RDqZ2OA%40mail.gmail.com
Backpatch-through: 17

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d33449024c8cb3420a664a598430125dca59cfa5

Modified Files
--------------
src/bin/scripts/t/100_vacuumdb.pl |  4 ++++
src/port/getopt_long.c            | 14 +++++++-------
2 files changed, 11 insertions(+), 7 deletions(-)



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

* pgsql: Fix option argument lookup in in-tree getopt_long().
@ 2026-09-11 20:20 Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Nathan Bossart @ 2026-09-11 20:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix option argument lookup in in-tree getopt_long().

The in-tree getopt_long() moves each non-option to the end of argv,
which might put it right where an option's argument lookup expects
to find the argument.  For example, "vacuumdb postgres --jobs"
takes "postgres" as the number of jobs instead of complaining that
--jobs is missing its argument.  To fix, stop the argument lookups
at the start of the moved non-options, which we already track to
know when to stop scanning.

Oversight in commit 411b720343.

Author: Sehrope Sarkuni <sehrope@jackdb.com>
Reviewed-by: solai v <solai.cdac@gmail.com>
Discussion: https://postgr.es/m/CAH7T-arxDuVCSkorO%3Dk7%2BM-_JV0JFzMpN_EtKMyD2K0RDqZ2OA%40mail.gmail.com
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a11bce64a3be38f726cdca682f1e5b723cfd34d1

Modified Files
--------------
src/bin/scripts/t/100_vacuumdb.pl |  4 ++++
src/port/getopt_long.c            | 14 +++++++-------
2 files changed, 11 insertions(+), 7 deletions(-)



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


end of thread, other threads:[~2026-09-11 20:20 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 20:20 pgsql: Fix option argument lookup in in-tree getopt_long(). Nathan Bossart <nathan@postgresql.org>
2026-09-11 20:20 pgsql: Fix option argument lookup in in-tree getopt_long(). Nathan Bossart <nathan@postgresql.org>
2026-09-11 20:20 pgsql: Fix option argument lookup in in-tree getopt_long(). Nathan Bossart <nathan@postgresql.org>
2026-09-11 20:20 pgsql: Fix option argument lookup in in-tree getopt_long(). Nathan Bossart <nathan@postgresql.org>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox