Thread: remove dbname arg from bootstrap mode

remove dbname arg from bootstrap mode

From
Alvaro Herrera
Date:
This little patch removes the dbname argument to InitPostgres in the
bootstrap mode.  It also cleans a bit of fallout: initdb uselessly
passing an unused database name, postmaster starting a dummy process,
and removes the -y option to the bootstrap process, which is
undocumented and useless.

Unless there are objections I intend to apply this shortly.
AFAICS it doesn't need a catversion bump.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Attachment

Re: remove dbname arg from bootstrap mode

From
Tom Lane
Date:
Alvaro Herrera <alvherre@commandprompt.com> writes:
> This little patch removes the dbname argument to InitPostgres in the
> bootstrap mode.  It also cleans a bit of fallout: initdb uselessly
> passing an unused database name, postmaster starting a dummy process,
> and removes the -y option to the bootstrap process, which is
> undocumented and useless.

(a) Doesn't postgres-ref.sgml need to be updated for this?
(b) What dummy process?
(c) Can't you remove the output-dbname argument you added to InitPostgres?

            regards, tom lane

Re: remove dbname arg from bootstrap mode

From
Alvaro Herrera
Date:
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > This little patch removes the dbname argument to InitPostgres in the
> > bootstrap mode.  It also cleans a bit of fallout: initdb uselessly
> > passing an unused database name, postmaster starting a dummy process,
> > and removes the -y option to the bootstrap process, which is
> > undocumented and useless.
>
> (a) Doesn't postgres-ref.sgml need to be updated for this?

Ah, that's where this was documented!  Sure.

> (b) What dummy process?

Startup and bgwriter (neither of which connect to a database)

> (c) Can't you remove the output-dbname argument you added to InitPostgres?

Hmm, I don't see how -- the autovacuum worker needs it.  And the return
value of InitPostgres is already taken by the is_superuser flag.

One simplification I tried in that area was making a separate
InitBootPostgres to cater for bootstrap, but the common code is too much
and too interleaved to be useful.

(I'm not sure if this last comment is related to this particular patch
or a gripe about the InitPostgres change in the autovac patch?)

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: remove dbname arg from bootstrap mode

From
Tom Lane
Date:
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> (c) Can't you remove the output-dbname argument you added to InitPostgres?

> (I'm not sure if this last comment is related to this particular patch
> or a gripe about the InitPostgres change in the autovac patch?)

No, I was thinking you could re-simplify, but I had the bootstrap and
autovac cases confused.  Never mind ...

            regards, tom lane