On 14/10/2026 11:04, Bohyun Lee wrote:
I think the ordering of checks in main() and setup() is the culprit
here. main() calls adjust_data_dir() first, which does this:

        snprintf(cmd, sizeof(cmd), "\"%s/postgres\" -D \"%s\" -C 
data_directory",
                         cluster->bindir, cluster->pgconfig);

to get the path to the data directory from the config. But
cluster->bindir isn't initialized yet.

Agreed on the ordering. The main() should first call check_bin_dirs()
to resolve the default new binary directory first and then call adjust_data_dir()
to find the actual data directory when a configuration-only directory
is specified, and then check_data_dir().

Committed, thanks for the review!

- Heikki



Reply via email to