summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/test
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-01-21 16:10:18 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-01-21 16:10:18 -0500
commit27a48e5a16ff2227ddf44ee717d9bcd89d22a7aa (patch)
tree7b1861a7d0f35c213a1a8e0db54a13daeb07cd81 /src/interfaces/ecpg/test
parent55dc86eca70b1dc18a79c141b3567efed910329d (diff)
Improve new wording of libpq's connection failure messages.
"connection to server so-and-so failed:" seems clearer than the previous wording "could not connect to so-and-so:" (introduced by 52a10224e), because the latter suggests a network-level connection failure. We're now prefixing this string to all types of connection failures, for instance authentication failures; so we need wording that doesn't imply a low-level error. Per discussion with Robert Haas. Discussion: https://postgr.es/m/CA+TgmobssJ6rS22dspWnu-oDxXevGmhMD8VcRBjmj-b9UDqRjw@mail.gmail.com
Diffstat (limited to 'src/interfaces/ecpg/test')
-rw-r--r--src/interfaces/ecpg/test/expected/connect-test5.stderr4
-rw-r--r--src/interfaces/ecpg/test/pg_regress_ecpg.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/interfaces/ecpg/test/expected/connect-test5.stderr b/src/interfaces/ecpg/test/expected/connect-test5.stderr
index 4dbf2c0fc46..db3cd9c2285 100644
--- a/src/interfaces/ecpg/test/expected/connect-test5.stderr
+++ b/src/interfaces/ecpg/test/expected/connect-test5.stderr
@@ -36,7 +36,7 @@
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port <DEFAULT> for user regress_ecpg_user2
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: could not open database: could not connect: FATAL: database "regress_ecpg_user2" does not exist
+[NO_PID]: ECPGconnect: could not open database: connection to server failed: FATAL: database "regress_ecpg_user2" does not exist
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
@@ -73,7 +73,7 @@
[NO_PID]: sqlca: code: -220, state: 08003
[NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port <DEFAULT> for user regress_ecpg_user2
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: could not open database: could not connect: FATAL: database "regress_ecpg_user2" does not exist
+[NO_PID]: ECPGconnect: could not open database: connection to server failed: FATAL: database "regress_ecpg_user2" does not exist
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
diff --git a/src/interfaces/ecpg/test/pg_regress_ecpg.c b/src/interfaces/ecpg/test/pg_regress_ecpg.c
index 8d43fd65bad..15f588a8023 100644
--- a/src/interfaces/ecpg/test/pg_regress_ecpg.c
+++ b/src/interfaces/ecpg/test/pg_regress_ecpg.c
@@ -80,7 +80,7 @@ ecpg_filter_source(const char *sourcefile, const char *outfile)
}
/*
- * Remove the details of "could not connect to ...: " error messages
+ * Remove the details of connection failure error messages
* in a test result file, since the target host/pathname and/or port
* can vary. Rewrite the result file in-place.
*
@@ -113,15 +113,15 @@ ecpg_filter_stderr(const char *resultfile, const char *tmpfile)
while (pg_get_line_buf(s, &linebuf))
{
- char *p1 = strstr(linebuf.data, "could not connect to ");
+ char *p1 = strstr(linebuf.data, "connection to server ");
if (p1)
{
- char *p2 = strstr(p1, ": ");
+ char *p2 = strstr(p1, "failed: ");
if (p2)
{
- memmove(p1 + 17, p2, strlen(p2) + 1);
+ memmove(p1 + 21, p2, strlen(p2) + 1);
/* we don't bother to fix up linebuf.len */
}
}