From 43b7455601a48c7ae211fb81c41f492e2c497c58 Mon Sep 17 00:00:00 2001 From: stalkerg Date: Tue, 27 Sep 2016 18:17:34 +0300 Subject: [PATCH] Add support for Postgres 10 in pgut lib --- pgut/pgut.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pgut/pgut.c b/pgut/pgut.c index e4775aea..43bbaf62 100644 --- a/pgut/pgut.c +++ b/pgut/pgut.c @@ -880,6 +880,16 @@ prompt_for_password(const char *username) password = NULL; } +#if PG_VERSION_NUM >= 100000 + if (username == NULL) + simple_prompt("Password: ", password, 100, false); + else + { + char message[256]; + snprintf(message, lengthof(message), "Password for user %s: ", username); + simple_prompt(message, password, 100, false); + } +#else if (username == NULL) password = simple_prompt("Password: ", 100, false); else @@ -888,6 +898,7 @@ prompt_for_password(const char *username) snprintf(message, lengthof(message), "Password for user %s: ", username); password = simple_prompt(message, 100, false); } +#endif } #endif