Re: Add comments for a postgres program in bootstrap mode

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: Add comments for a postgres program in bootstrap mode
Дата
Msg-id CA+HiwqHv9wr8faXBeEJ-5Ptk3TGka_PbmYtNf190QmMk60eDiA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add comments for a postgres program in bootstrap mode  (Youki Shiraishi <shiraishi@computer.org>)
Ответы Re: Add comments for a postgres program in bootstrap mode  (Youki Shiraishi <shiraishi@computer.org>)
Список pgsql-hackers
On Fri, Sep 27, 2019 at 12:52 PM Youki Shiraishi <shiraishi@computer.org> wrote:
> On Fri, Sep 27, 2019 at 12:10 AM Amit Langote <amitlangote09@gmail.com> wrote:
> > On Thu, Sep 26, 2019 at 6:32 PM Youki Shiraishi <shiraishi@computer.org> wrote:
> > > On Thu, Sep 26, 2019 at 5:38 PM Amit Langote <amitlangote09@gmail.com> wrote:
> > > > + /* Bootstrap mode for initdb */
> > > >   if (argc > 1 && strcmp(argv[1], "--boot") == 0)
> > > >   AuxiliaryProcessMain(argc, argv); /* does not return */
> > > >   else if (argc > 1 && strcmp(argv[1], "--describe-config") == 0)
> > > >
> > > > How about expanding that comment just a little bit, say:
> > > >
> > > >     /*
> > > >      * Bootstrapping is handled by AuxiliaryProcessMain() for historic
> > > >      * reasons.
> > > >      */
> >
> > Do you any thoughts on this suggestion?
>
> Sorry, I missed your suggestion.
> The purpose of a comment here is to direct hackers to initdb.c because
> the --boot option is used only by initdb.
> initdb.c describes why it uses the --boot option (i.e., historical
> reason), so I think it should not be described in main.c.

Sorry, I didn't really mean to take out the "for initdb" part.  So, I
should've suggested this

    /*
     * Bootstrap mode for initdb.  Bootstrapping is handled by
     * AuxiliaryProcessMain() for historical reasons.
     */

IMO, it would be good for this comment to say why
AuxiliaryProcessMain() is invoked here instead of, say,
PostgresMain().  "for historical reasons" may not be enough but maybe
it is.

Thanks,
Amit



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Hooks for session start and end, take two
Следующее
От: Youki Shiraishi
Дата:
Сообщение: Re: Add comments for a postgres program in bootstrap mode