mirror of
https://github.com/postgres/postgres.git
synced 2025-08-12 15:23:02 +03:00
Revert "pg_resetwal: Improve error with wrong/missing data directory"
This reverts commit 1d863c2504
.
This broke specifying the data directory as a relative path.
Reported-by: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
Discussion: https://www.postgresql.org/message-id/flat/TYAPR01MB58664AD301F511B1EA5B72B4F5C0A%40TYAPR01MB5866.jpnprd01.prod.outlook.com
This commit is contained in:
@@ -345,10 +345,6 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
get_restricted_token();
|
get_restricted_token();
|
||||||
|
|
||||||
if (chdir(DataDir) < 0)
|
|
||||||
pg_fatal("could not change directory to \"%s\": %m",
|
|
||||||
DataDir);
|
|
||||||
|
|
||||||
/* Set mask based on PGDATA permissions */
|
/* Set mask based on PGDATA permissions */
|
||||||
if (!GetDataDirectoryCreatePerm(DataDir))
|
if (!GetDataDirectoryCreatePerm(DataDir))
|
||||||
pg_fatal("could not read permissions of directory \"%s\": %m",
|
pg_fatal("could not read permissions of directory \"%s\": %m",
|
||||||
@@ -356,6 +352,10 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
umask(pg_mode_mask);
|
umask(pg_mode_mask);
|
||||||
|
|
||||||
|
if (chdir(DataDir) < 0)
|
||||||
|
pg_fatal("could not change directory to \"%s\": %m",
|
||||||
|
DataDir);
|
||||||
|
|
||||||
/* Check that data directory matches our server version */
|
/* Check that data directory matches our server version */
|
||||||
CheckDataVersion();
|
CheckDataVersion();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user