Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vDOFC-0086bC-5y for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Oct 2025 14:30:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vDOFA-007uPf-Iu for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Oct 2025 14:30:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vDOFA-007uPU-AP for pgsql-bugs@lists.postgresql.org; Mon, 27 Oct 2025 14:30:43 +0000 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vDOF7-0042gJ-0q for pgsql-bugs@lists.postgresql.org; Mon, 27 Oct 2025 14:30:42 +0000 Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-945a33e0d55so76201339f.1 for ; Mon, 27 Oct 2025 07:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761575439; x=1762180239; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9Zd9bxMBnPy5U/lxs1fr7niBgOz79avZxski2gu0csQ=; b=LjnAm7y5PTYFo+UVPDc/K67a81jtp7OA7L9CkFn+HRlL+9s16fH/RycbMe2ypTXdru bvWf+FD42safkDtpRXpOc6pC/QLEkIBUDHgw2XlNL1EHkzqouAqvZKI56YSMRza5muzF Rf9vYz4ZX5AXlrZmhXfxzRWKlPVCTj1qh/zzwNQh6G5mOVCRKc4i4Ewm+x7ZXUzhiiLf 0+z+ylq0VwGA/sDI18quEqVGZfVmClRYzxXPZht4H3D7+AsKK0g4N2bnfttrDWT5Eu3t iHebdZ8b876IJnzIFdvd3F9RzpUKgw8WUEPsKU8CSNPKfTEJ5hUMA9HzyktKz/sH4Gmp EOXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761575439; x=1762180239; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9Zd9bxMBnPy5U/lxs1fr7niBgOz79avZxski2gu0csQ=; b=NaIcK68qWm2VN/564nNFdZ78dZ6rt/rrU1FA2B6btrPKvHbqTsxfhe5jjwtcrfMfVB UvCtHtDp5cONMtGZY7eCTPNOrxN4hyAFR7t2ou4DHaFL4xgGUfADy2YBN6f9h0eze4Fp GlY3n62r+eebGSRjopYsM8e19ES79xw+M3DNrvWtwNSnUz0b3QxIENcWavmJ2ZDxjXzL 7wzjIzPH6NzSnjl/pwR5q+Jz49WencdczAjY0/Flxx0+NgAY7KkysBJripfy7zIr3D5Q oo+KhkcvYezaTAry6nFxiJXJ6yfUgDKa8EE6lJWzY7HI2Veypb8bC7T8BkJi8fJm8MAz EW6A== X-Forwarded-Encrypted: i=1; AJvYcCWZKWKGgXP+ejC4RfUHz8yRQ5znzC1mAIZXHKMMTm/fbt68D6eq3i7OwJ60GURtfC79Y4PUeo7unNZA@lists.postgresql.org X-Gm-Message-State: AOJu0YzIelaGLhjS/dCjfmKNqFr/HDtk9xYpYjKNFBt8kFAQqPV5rbqm H4kzb+VszVYuoILdzlSm/E7mzXD4qiLQEiaIqkJmFEURRlCeI+0TERS6 X-Gm-Gg: ASbGncv9X9qzTkyVWRwHPsVFEBX/GWbpRlXQU4BuDKHWQQ/j22xqTaTStbVaUA9men/ +vDudWAi++vc2uZCTnW4R8PKiYexSwUraIOZeXcOgMfYlcoB7y0ctwEv1WTCVq5Lw0OixtH6R8b ROEjcuWWLUaRmJ41GvyJapM0JI3hgMRJU4l9yDWQqHFcYMkKID4mUz4etEAt3qiQGMULhwUp4uP i5Zxv1y7cSP81deP2OsvRVOyTH/a+JZ0OMAgi6KIQkNuIYlISyBduGlQULggr6/58MHPpvkhdme OyUOqrLdkbMfx78m4eV3lqCoALqGXaKXjxWLKCTqqX7mkfvT1driqaHczCz25iZiYZ7PZmME4aC +KlBldm25475NejHnSLt8O8R7xtk+ceLbhf0CxEKTgmjxxB0R1Hlalj0bxcL5lP4Pn9Fsl+vo07 TSNLDcw2XtomYrRjN4xQSqifEJTsFhUpfX+tzPJgm9c9oQM/JLELv5ZwWVifgm0Htmma27Ys5RN Xc8 X-Google-Smtp-Source: AGHT+IGmdOb213YX+BboUvxDTvpnKa6GyH4YcATugDcEnEL6YRa8jjBY5UaRgxiOS0Z1/ntU+Vj1zQ== X-Received: by 2002:a05:6e02:1f11:b0:431:d864:366a with SMTP id e9e14a558f8ab-4320f6a766dmr4530895ab.2.1761575439340; Mon, 27 Oct 2025 07:30:39 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-94359f11fa0sm247004339f.16.2025.10.27.07.30.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 07:30:38 -0700 (PDT) Date: Mon, 27 Oct 2025 09:30:36 -0500 From: Nathan Bossart To: Daniel Gustafsson Cc: Peter Eisentraut , Andres Freund , Tom Lane , Matthias =?utf-8?Q?H=C3=B6rmann?= , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19042: Option --help not recognized at the end of command line in pg_restore Message-ID: References: <19042-347869ae37c993f4@postgresql.org> <144DDCC5-8EB1-4AA2-91FB-36916898A86F@yesql.se> <804476.1756911473@sss.pgh.pa.us> <53lkszuko3qwk4sn6mxz5dl6yahkosrksm3pcxjikcuxj3vssq@jwzipa3ikold> <513f6b2f-e6be-423d-aad6-4ab58988278b@eisentraut.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Oct 25, 2025 at 12:26:01AM +0200, Daniel Gustafsson wrote: > While hacking on this it seemed like a good idea to move to using progname > consistently, and reduce scope in some places from global variables, but > looking at it now I'm less convinced. At the very least it should be ripped > out into its own patch but for now those changes are left in there. Yeah, that does feel like it ought to be its own patch. After a read-through, 0001 looks like the right idea to me, though. It's a larger patch, but the majority of the changes are pretty mechanical. +/* port/pg_option_utils.c */ +extern bool is_help_param(int argc, char *argv[], int optind); And fe_utils/option_utils.c, right (since it has a copy of this function)? Or is the idea to use pg_option_utils.c for both the frontend and the backend? > It's far from an exciting patchset but it would be nice to get it done once and > for all. 0002 is a small change to make sure all apps exit with the same code, > I was unable to find a documented rationale for exit(2) so I think it's an > oversight. 0002 LGTM -- nathan