Skip to content

Commit

Permalink
Fixed initdb error without -D options
Browse files Browse the repository at this point in the history
Fixed an error where the database was not created when initdb was used with
AGDATA environment argument.
  • Loading branch information
yjy44 authored and emotionbug committed Sep 7, 2022
1 parent a3cc1c3 commit b6a1729
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bin/initdb/initdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2474,7 +2474,11 @@ setup_pgdata(void)

if (!pg_data)
{
pgdata_get_env = getenv("PGDATA");
pgdata_get_env = getenv("AGDATA");
if (!pgdata_get_env || !strlen(pgdata_get_env))
{
pgdata_get_env = getenv("PGDATA");
}
if (pgdata_get_env && strlen(pgdata_get_env))
{
/* PGDATA found */
Expand Down

0 comments on commit b6a1729

Please sign in to comment.