Re: Move bki file pre-processing from initdb to bootstrap - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Move bki file pre-processing from initdb to bootstrap
Date
Msg-id 665c448a-373f-4a2b-b379-b50c507e939f@eisentraut.org
Whole thread Raw
In response to Re: Move bki file pre-processing from initdb to bootstrap  (Krishnakumar R <kksrcv001@gmail.com>)
List 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.




pgsql-hackers by date:

Previous
From: Nazir Bilal Yavuz
Date:
Subject: Re: Failure during Building Postgres in Windows with Meson
Next
From: Peter Eisentraut
Date:
Subject: Re: Move bki file pre-processing from initdb to bootstrap