Thread

Commits

  1. Fix outdated --help message for postgres -f

  1. fix stale help message

    Junwang Zhao <zhjwpku@gmail.com> — 2022-08-10T15:32:18Z

    when parsing command-line options, the -f option support disabling
    8 scan and join methods, o, b and t disable index-only scans,
    bitmap index scans, and TID scans respectively, add them to the
    help message.
    
    diff --git a/src/backend/main/main.c b/src/backend/main/main.c
    index 5a964a0db6..f5da4260a1 100644
    --- a/src/backend/main/main.c
    +++ b/src/backend/main/main.c
    @@ -351,7 +351,7 @@ help(const char *progname)
            printf(_("  -?, --help         show this help, then exit\n"));
    
            printf(_("\nDeveloper options:\n"));
    -       printf(_("  -f s|i|n|m|h       forbid use of some plan
    types\n"));
    +       printf(_("  -f s|i|o|b|t|n|m|h forbid use of some plan
    types\n"));
            printf(_("  -n                 do not reinitialize shared
    memory after abnormal exit\n"));
            printf(_("  -O                 allow system table structure
    changes\n"));
            printf(_("  -P                 disable system indexes\n"));
    
    -- 
    Regards
    Junwang Zhao
    
  2. Re: fix stale help message

    Junwang Zhao <zhjwpku@gmail.com> — 2022-08-13T01:03:29Z

    Hi peter,
    
    Sorry to bother, but I notice that you are one of the most active
    committers, can you pls take a look at this thread.
    
    Thanks!
    
    On Wed, Aug 10, 2022 at 11:32 PM Junwang Zhao <zhjwpku@gmail.com> wrote:
    >
    > when parsing command-line options, the -f option support disabling
    > 8 scan and join methods, o, b and t disable index-only scans,
    > bitmap index scans, and TID scans respectively, add them to the
    > help message.
    >
    > diff --git a/src/backend/main/main.c b/src/backend/main/main.c
    > index 5a964a0db6..f5da4260a1 100644
    > --- a/src/backend/main/main.c
    > +++ b/src/backend/main/main.c
    > @@ -351,7 +351,7 @@ help(const char *progname)
    >         printf(_("  -?, --help         show this help, then exit\n"));
    >
    >         printf(_("\nDeveloper options:\n"));
    > -       printf(_("  -f s|i|n|m|h       forbid use of some plan
    > types\n"));
    > +       printf(_("  -f s|i|o|b|t|n|m|h forbid use of some plan
    > types\n"));
    >         printf(_("  -n                 do not reinitialize shared
    > memory after abnormal exit\n"));
    >         printf(_("  -O                 allow system table structure
    > changes\n"));
    >         printf(_("  -P                 disable system indexes\n"));
    >
    > --
    > Regards
    > Junwang Zhao
    
    
    
    -- 
    Regards
    Junwang Zhao
    
    
    
    
  3. Re: fix stale help message

    Michael Paquier <michael@paquier.xyz> — 2022-08-14T10:16:57Z

    On Wed, Aug 10, 2022 at 11:32:18PM +0800, Junwang Zhao wrote:
    > when parsing command-line options, the -f option support disabling
    > 8 scan and join methods, o, b and t disable index-only scans,
    > bitmap index scans, and TID scans respectively, add them to the
    > help message.
    >
    > @@ -351,7 +351,7 @@ help(const char *progname)
    >         printf(_("  -?, --help         show this help, then exit\n"));
    > 
    >         printf(_("\nDeveloper options:\n"));
    > -       printf(_("  -f s|i|n|m|h       forbid use of some plan
    > types\n"));
    > +       printf(_("  -f s|i|o|b|t|n|m|h forbid use of some plan
    > types\n"));
    >         printf(_("  -n                 do not reinitialize shared
    > memory after abnormal exit\n"));
    >         printf(_("  -O                 allow system table structure
    > changes\n"));
    >         printf(_("  -P                 disable system indexes\n"));
    
    set_plan_disabling_options() is telling that you have all of them, as
    much as the docs.  I don't mind fixing that as you suggest, FWIW.
    --
    Michael
    
  4. Re: fix stale help message

    Junwang Zhao <zhjwpku@gmail.com> — 2022-08-14T13:03:15Z

    Hi Michael,
    
    Thanks for your reply :)
    
    I think the goal of `help message` is to tell users(like DBA) how
    to use postgres, so it's better to provide a complete view.
    
    I'm not sure by saying `set_plan_disabling_options` do you mean
    the postgres source code? If that's the case, I think most of the
    installations don't have source code but just binaries, people will
    reference the help message by running `postgres --help`.
    
    BTW, I noticed in [0] the doc gives the full options, so I think we
    should keep the source code in consistent with the doc.
    
    [0] https://www.postgresql.org/docs/current/app-postgres.html
    
    On Sun, Aug 14, 2022 at 6:17 PM Michael Paquier <michael@paquier.xyz> wrote:
    >
    > On Wed, Aug 10, 2022 at 11:32:18PM +0800, Junwang Zhao wrote:
    > > when parsing command-line options, the -f option support disabling
    > > 8 scan and join methods, o, b and t disable index-only scans,
    > > bitmap index scans, and TID scans respectively, add them to the
    > > help message.
    > >
    > > @@ -351,7 +351,7 @@ help(const char *progname)
    > >         printf(_("  -?, --help         show this help, then exit\n"));
    > >
    > >         printf(_("\nDeveloper options:\n"));
    > > -       printf(_("  -f s|i|n|m|h       forbid use of some plan
    > > types\n"));
    > > +       printf(_("  -f s|i|o|b|t|n|m|h forbid use of some plan
    > > types\n"));
    > >         printf(_("  -n                 do not reinitialize shared
    > > memory after abnormal exit\n"));
    > >         printf(_("  -O                 allow system table structure
    > > changes\n"));
    > >         printf(_("  -P                 disable system indexes\n"));
    >
    > set_plan_disabling_options() is telling that you have all of them, as
    > much as the docs.  I don't mind fixing that as you suggest, FWIW.
    > --
    > Michael
    
    
    
    -- 
    Regards
    Junwang Zhao
    
    
    
    
  5. Re: fix stale help message

    Michael Paquier <michael@paquier.xyz> — 2022-08-15T04:41:14Z

    On Sun, Aug 14, 2022 at 09:03:15PM +0800, Junwang Zhao wrote:
    > I'm not sure by saying `set_plan_disabling_options` do you mean
    > the postgres source code? If that's the case, I think most of the
    > installations don't have source code but just binaries, people will
    > reference the help message by running `postgres --help`.
    
    I am just telling that your patch does the right thing, based on the
    state of the code and the contents of the docs.  Applied down to 10.
    --
    Michael