aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2017-11-11 14:33:02 -0800
committerNoah Misch <noah@leadboat.com>2017-11-11 14:33:25 -0800
commit3c80348d24914d9ddf65d56d2c343a7f2b820705 (patch)
tree26392cef3b7436231a5ccd4def5bc6d20d6238de /src
parent742471ef978c95443c8fd96118360d88b57a30fc (diff)
downloadpostgresql-3c80348d24914d9ddf65d56d2c343a7f2b820705.tar.gz
postgresql-3c80348d24914d9ddf65d56d2c343a7f2b820705.zip
Make connect/test1 independent of localhost IPv6.
Since commit 868898739a8da9ab74c105b8349b7b5c711f265a, it has assumed "localhost" resolves to both ::1 and 127.0.0.1. We gain nothing from that assumption, and it does not hold in a default installation of Red Hat Enterprise Linux 5. Back-patch to 9.3 (all supported versions).
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/test/connect/test1.pgc2
-rw-r--r--src/interfaces/ecpg/test/expected/connect-test1.c2
-rw-r--r--src/interfaces/ecpg/test/expected/connect-test1.stderr7
3 files changed, 4 insertions, 7 deletions
diff --git a/src/interfaces/ecpg/test/connect/test1.pgc b/src/interfaces/ecpg/test/connect/test1.pgc
index 4868b3dd81e..1ffb8c2fbea 100644
--- a/src/interfaces/ecpg/test/connect/test1.pgc
+++ b/src/interfaces/ecpg/test/connect/test1.pgc
@@ -54,7 +54,7 @@ exec sql end declare section;
exec sql disconnect;
/* wrong port */
- exec sql connect to tcp:postgresql://localhost:20/ecpg2_regression user regress_ecpg_user1 identified by connectpw;
+ exec sql connect to tcp:postgresql://127.0.0.1:20/ecpg2_regression user regress_ecpg_user1 identified by connectpw;
/* no disconnect necessary */
/* wrong password */
diff --git a/src/interfaces/ecpg/test/expected/connect-test1.c b/src/interfaces/ecpg/test/expected/connect-test1.c
index 6471abb623e..fd9be20f585 100644
--- a/src/interfaces/ecpg/test/expected/connect-test1.c
+++ b/src/interfaces/ecpg/test/expected/connect-test1.c
@@ -109,7 +109,7 @@ main(void)
/* wrong port */
- { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:20/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "tcp:postgresql://127.0.0.1:20/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , NULL, 0); }
#line 57 "test1.pgc"
/* no disconnect necessary */
diff --git a/src/interfaces/ecpg/test/expected/connect-test1.stderr b/src/interfaces/ecpg/test/expected/connect-test1.stderr
index 0e43a1a3988..ad806a02251 100644
--- a/src/interfaces/ecpg/test/expected/connect-test1.stderr
+++ b/src/interfaces/ecpg/test/expected/connect-test1.stderr
@@ -63,13 +63,10 @@
[NO_PID]: sqlca: code: -402, state: 08001
[NO_PID]: raising sqlcode -220 on line 54: connection "CURRENT" does not exist on line 54
[NO_PID]: sqlca: code: -220, state: 08003
-[NO_PID]: ECPGconnect: opening database ecpg2_regression on localhost port <REGRESSION_PORT> for user regress_ecpg_user1
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on 127.0.0.1 port <REGRESSION_PORT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: could not open database: could not connect to server: Connection refused
- Is the server running on host "localhost" (::1) and accepting
- TCP/IP connections on port 20?
-could not connect to server: Connection refused
- Is the server running on host "localhost" (127.0.0.1) and accepting
+ Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 20?
[NO_PID]: sqlca: code: 0, state: 00000