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.



Reply via email to