Re: Better error message when --single is not the first arg to postgres executable

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Greg Sabino Mullane <htamfids@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-12-03T19:57:15Z
Lists: pgsql-hackers

Attachments

Thanks to Álvaro and Tom for reviewing.

On Tue, Dec 03, 2024 at 01:01:29PM -0500, Tom Lane wrote:
> +/* special must-be-first options for dispatching to various subprograms */
> +typedef enum Subprogram
> +{
> +	SUBPROGRAM_CHECK,
> +	... etc
> 
> "Subprogram" doesn't quite seem like the right name for this enum.
> These are not subprograms, they are options.  I'm not feeling
> especially inventive today, so this might be a lousy suggestion,
> but how about
> 
> typedef enum DispatchOption
> {
> 	DISPATCH_CHECK,
> 	... etc

WFM.  An alternative might be SubprogramOption, but I don't have any strong
opinions on the matter.  I've switched it to DispatchOption in the attached
patch.

-- 
nathan

Commits

  1. Provide a better error message for misplaced dispatch options.