initdb fails to initialize data directory
Nikhil Sontakke <nikhils@2ndquadrant.com>
From: Nikhil Sontakke <nikhils@2ndquadrant.com>
To: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2018-04-19T08:52:33Z
Lists: pgsql-hackers
Attachments
- initdb_path_variable.patch (application/octet-stream) patch
Hi, Encountered the following behavior with initdb on one of our test builds while using latest master head: initdb -D $DATADIR The program "postgres" was found by "/Users/nikhils/install/bin/initdb" but was not the same version as initdb. Check your installation. Intrigued, on digging down further, this is happening because we are not using a long enough buffer to accept the output of "postgres -V" in the find_other_exec() function. In our case, we had used --with-extra-version option with configure which caused the output of "postgres -V" to go a little beyond the current "line" variable size. This caused the strcmp to fail leading to initdb refusing to initialize any data directories at all. PFA, a patch which uses MAXPGPATH for the variable size. Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL/Postgres-XL Development, 24x7 Support, Training & Services
Commits
-
Enlarge find_other_exec's meager fgets buffer
- e668507d36f8 9.4.18 landed
- e2f3b6560383 10.4 landed
- e160fa005e80 9.5.13 landed
- cea5f9aa1244 11.0 landed
- b3f4742aab82 9.6.9 landed
- 070179a4a2f8 9.3.23 landed