Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJp3M-0006QD-1g for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jul 2023 05:39:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qJp3J-00029J-Nu for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jul 2023 05:39:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJp3J-00029A-Eh for pgsql-hackers@lists.postgresql.org; Thu, 13 Jul 2023 05:39:45 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qJp3G-000AS4-KY for pgsql-hackers@postgresql.org; Thu, 13 Jul 2023 05:39:44 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id EEF88320051E; Thu, 13 Jul 2023 01:39:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 13 Jul 2023 01:39:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1689226779; x=1689313179; bh=vp xbUBdFIknto/A/ExF4MR9YyJjmh9lSzerU8+6IEOY=; b=qgs5Y8+ZFFf2gbbztW Mmc3cqLRZHbkZDTVoGlCLh0m5OecpVf4/hrkdszRb/50yy1F0qQUiAQx5uQ9KkpL /yvyRcMbm6GklwHmDfQwiWBNPJxEuJ1nlzXz/sqbshA7NE2vwDJ7xryPgU69OB26 lpdmumoQsOOZNsl5WfPedZeymFQefW2b2tS34ppemYsDqFYUzW4+NBCsF/xLAKXi hP9Ykaheh8A/+ziL1JUGIPSO1F/8+Q7VzNyq81DwQOXrGHIC9xQfG7mlYRqmLxdN sgPaGSrpQ58fK/EWpELzW64wbD+dBFXpYeWQsDzBpq2sgnqjEg2uZvtfYMgePjk0 tCNw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1689226779; x=1689313179; bh=vpxbUBdFIknto /A/ExF4MR9YyJjmh9lSzerU8+6IEOY=; b=z9LXYlRAE2gw1a4sJmNRVVIZttqFd u8GwgnzxCnW9DpyBJb3maFi4DBG9f6iZcF9SrQ+D/Jb4/ito/cRq9yRoeOaPWV1J pmgfXyFmnHEze2j1RiVws808t2EqNEv7agzSQFQT6f3WtMkoStJbTXmz7GB6uq31 sxLMH/Ey7A0yvvYewNcyvV5E3CDRle8szBP/TbTxXm5kIiBKiKxQZqjCDJ8Lc2WF tcNs3u0jBi2NO8xw5U8xk6S/OeeBpqaDs0IYmt3VliJsmTfXIVpFjdXOpCLopU02 lBAJaAsRwQ+4YCNMBMCcl6KY1i3l3ezyt+lG0QCnHC/I9+BXTcqNQvQ8g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrfeefgdelhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 13 Jul 2023 01:39:37 -0400 (EDT) Date: Thu, 13 Jul 2023 14:39:32 +0900 From: Michael Paquier To: Nathan Bossart Cc: Kyotaro Horiguchi , noah@leadboat.com, pgsql-hackers@postgresql.org Subject: Re: add non-option reordering to in-tree getopt_long Message-ID: 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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QPFcfsR0hCjNIHph" Content-Disposition: inline In-Reply-To: <20230713034903.GA991765@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --QPFcfsR0hCjNIHph Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 a= ll > uses of getopt_long() in PostgreSQL earlier today, and of the programs th= at > accepted non-options, most accepted only one, some others accepted 2-3, a= nd > 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. >=20 > 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 --QPFcfsR0hCjNIHph Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmSvjhQACgkQnvQgOdby QH1G9w/+OvUBJ0k/iNRc5XKHiompLpDiqpKSLV4Uy02gYKfmpBB4IjWQO9M8J9x+ onlA5aFGerXMQCIP3vovjWekyj0ymISP5TrRWYcmzeWDNjOFC6X2fmyEFpTAEizc eh8mEvacrQPfPHvpPBT5b8kRaeVD/7p1sX2+ktudcK1Q2gqEI5U73sNCmYqJejMq Akd/JD0nlxxbGtArzJPfq+gzR3KYoY4rAQLRJGFDyFPFgYFgr9PsWL77Td4QxH87 VcuAoI82L7EPklEQR0prXTCVe3hXnZIvwOapLKJWpwp6G9QdNtTJoU4shC60VWb5 0rtNKeGnUfdoMszHcKmFkSdGNwKVH6P4zfTCsfIQBupiHenLNhJoV9biPWiS0Bwe 73iBS0/EDQIj87i9ttcKTdv4xuoa1BiqXzANQbkowMejdSvXMVhc68zXg5XYPexb mjo6ASWUVtCj2LKLYhqPZl21ju49+J2QsnURtq2GdLMDQBjjjb5NqoLypSwoz2zX AgwCaQESVuyK+iSWV6AbNj9WDbVB6ES+1Krl8xeGj/qAidgFErVuOqdMuBLv0dpe KqHvze4iMia4AZCoYxPGi5YT/cHI5ynZoAOc8I6s5UJnVPNnu6jw5oa5ndcPbMq8 E+GWb6u19uPglqIAam5Pw92uUIGCGGTi6Jk7Wk8lmM4xopDTWMQ= =+Jng -----END PGP SIGNATURE----- --QPFcfsR0hCjNIHph--