aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/reindexdb.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2013-12-18 12:16:16 -0500
committerBruce Momjian <bruce@momjian.us>2013-12-18 12:16:21 -0500
commit613c6d26bd42dd8c2dd0664315be9551475b8864 (patch)
treee0eb178bf76220fc9b082d9e849bee67c03f9e13 /src/bin/scripts/reindexdb.c
parent11ac4c73cb89551d7e0d0180b58d82186f072f8d (diff)
downloadpostgresql-613c6d26bd42dd8c2dd0664315be9551475b8864.tar.gz
postgresql-613c6d26bd42dd8c2dd0664315be9551475b8864.zip
Fix incorrect error message reported for non-existent users
Previously, lookups of non-existent user names could return "Success"; it will now return "User does not exist" by resetting errno. This also centralizes the user name lookup code in libpgport. Report and analysis by Nicolas Marchildon; patch by me
Diffstat (limited to 'src/bin/scripts/reindexdb.c')
-rw-r--r--src/bin/scripts/reindexdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c
index f7c09bebf8a..4e762ea56f4 100644
--- a/src/bin/scripts/reindexdb.c
+++ b/src/bin/scripts/reindexdb.c
@@ -188,7 +188,7 @@ main(int argc, char *argv[])
else if (getenv("PGUSER"))
dbname = getenv("PGUSER");
else
- dbname = get_user_name(progname);
+ dbname = get_user_name_or_exit(progname);
}
reindex_system_catalogs(dbname, host, port, username, prompt_password,
@@ -203,7 +203,7 @@ main(int argc, char *argv[])
else if (getenv("PGUSER"))
dbname = getenv("PGUSER");
else
- dbname = get_user_name(progname);
+ dbname = get_user_name_or_exit(progname);
}
if (indexes.head != NULL)