pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: noah@leadboat.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: add non-option reordering to in-tree getopt_long
Date: Thu, 13 Jul 2023 14:39:32 +0900
Message-ID: <ZK+OFMbpICfO1aTR@paquier.xyz> (raw)
In-Reply-To: <20230713034903.GA991765@nathanxps13>
References: <20230710.165711.1906730109995973216.horikyota.ntt@gmail.com>
	<20230710181237.GD257945@nathanxps13>
	<20230710200658.GA362078@nathanxps13>
	<20230711.161609.1881651378858129172.horikyota.ntt@gmail.com>
	<20230711163232.GA616878@nathanxps13>
	<20230713034903.GA991765@nathanxps13>

On Wed, Jul 12, 2023 at 08:49:03PM -0700, Nathan Bossart wrote:
> After a couple more small edits, I've committed this.  I looked through all
> uses of getopt_long() in PostgreSQL earlier today, and of the programs that
> accepted non-options, most accepted only one, some others accepted 2-3, and
> ecpg and pg_regress accepted any number.  Given this analysis, I'm not too
> worried about the O(n^2) behavior that the patch introduces.  You'd likely
> need to provide an enormous number of non-options for it to be noticeable,
> and I'm dubious such use-cases exist.
> 
> During my analysis, I noticed that pg_ctl contains a workaround for the
> lack of argument reordering.  I think this can now be removed.  Patch
> attached.

Interesting piece of history that you have found here, coming from
f3d6d94 back in 2004.  The old pg_ctl.sh before that did not need any
of that.  It looks sensible to do something about that.

Something does not seem to be right seen from here, a CI run with
Windows 2019 fails when using pg_ctl at the beginning of most of the
tests, like:
[04:56:07.404] ------------------------------------- 8< -------------------------------------
[04:56:07.404] stderr:
[04:56:07.404] pg_ctl: too many command-line arguments (first is "-D")
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (37+ messages)  latest in thread

Message-ID: <ZK+OFMbpICfO1aTR@paquier.xyz>
Permalink:  ../ZK+OFMbpICfO1aTR@paquier.xyz/
Also on:    postgresql.org/message-id/ZK+OFMbpICfO1aTR@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: michael@paquier.xyz, nathandbossart@gmail.com, horikyota.ntt@gmail.com, noah@leadboat.com
  Subject: Re: add non-option reordering to in-tree getopt_long
  In-Reply-To: <ZK+OFMbpICfO1aTR@paquier.xyz>
  References: <20230710.165711.1906730109995973216.horikyota.ntt@gmail.com> <20230710181237.GD257945@nathanxps13> <20230710200658.GA362078@nathanxps13> <20230711.161609.1881651378858129172.horikyota.ntt@gmail.com> <20230711163232.GA616878@nathanxps13> <20230713034903.GA991765@nathanxps13> <ZK+OFMbpICfO1aTR@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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