Re: Move bki file pre-processing from initdb to bootstrap

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Krishnakumar R <kksrcv001(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: Move bki file pre-processing from initdb to bootstrap
Date: 2023-11-10 08:38:11
Message-ID: 665c448a-373f-4a2b-b379-b50c507e939f@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 06.10.23 02:24, Krishnakumar R wrote:
>> elog(INFO, "Open bki file %s\n", bki_file);
>> + boot_yyin = fopen(bki_file, "r");
>>
>> Why is this needed? It already reads the bki file from stdin?
> We no longer open the bki file in initdb and pass to postgres to parse
> from stdin, instead we open the bki file directly in bootstrap and
> pass the file stream to the parser. Hence the need to switch the yyin.
> Have added a comment in the commit logs to capture this.

Why this change? I mean, there is nothing wrong with it, but I don't
follow how changing from reading from stdin to reading from a named file
is related to moving the parameter substitution from initdb to the backend.

One effect of this is that we would now have two different ways initdb
interacts with the backend. In bootstrap mode, it reads from a named
file, and the second run (the one that loads the system views etc.)
reads from stdin. It's already confusing enough, so any further
divergence should be adequately explained.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2023-11-10 08:48:37 Re: Move bki file pre-processing from initdb to bootstrap
Previous Message Nazir Bilal Yavuz 2023-11-10 08:29:34 Re: Failure during Building Postgres in Windows with Meson