1 /* Processed by ecpg (regression mode) */
2 /* These include files are added by the preprocessor */
7 /* End of automatic include section */
8 #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
12 * this file tests all sorts of connecting to one single database.
20 /* do not include regression.h */
25 /* exec sql begin declare section */
34 /* exec sql end declare section */
40 { ECPGconnect(__LINE__, 0, "connectdb" , NULL,NULL , "main", 0); }
43 { ECPGdo(__LINE__, 0, 1, NULL, "alter user connectuser encrypted password 'connectpw'", ECPGt_EOIT, ECPGt_EORT);}
46 { ECPGdisconnect(__LINE__, "CURRENT");}
48 /* <-- "main" not specified */
50 { ECPGconnect(__LINE__, 0, "connectdb@localhost" , NULL,NULL , "main", 0); }
53 { ECPGdisconnect(__LINE__, "main");}
57 { ECPGconnect(__LINE__, 0, "@localhost" , "connectdb" , NULL , "main", 0); }
60 { ECPGdisconnect(__LINE__, "main");}
64 { ECPGconnect(__LINE__, 0, "connectdb@localhost:55432" , NULL,NULL , "main", 0); }
67 { ECPGdisconnect(__LINE__, "main");}
71 { ECPGconnect(__LINE__, 0, "@localhost:55432" , "connectdb" , NULL , "main", 0); }
74 { ECPGdisconnect(__LINE__, "main");}
78 { ECPGconnect(__LINE__, 0, "connectdb:55432" , NULL,NULL , "main", 0); }
81 { ECPGdisconnect(__LINE__, "main");}
85 { ECPGconnect(__LINE__, 0, ":55432" , "connectdb" , NULL , "main", 0); }
88 { ECPGdisconnect(__LINE__, "main");}
92 { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/connectdb" , "connectuser" , "connectpw" , NULL, 0); }
95 { ECPGdisconnect(__LINE__, "CURRENT");}
99 { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/" , "connectdb" , NULL , NULL, 0); }
102 { ECPGdisconnect(__LINE__, "CURRENT");}
106 strcpy(pw, "connectpw");
107 strcpy(db, "tcp:postgresql://localhost:55432/connectdb");
108 { ECPGconnect(__LINE__, 0, db , "connectuser" , pw , NULL, 0); }
111 { ECPGdisconnect(__LINE__, "CURRENT");}
115 { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , "connectpw" , NULL, 0); }
118 { ECPGdisconnect(__LINE__, "CURRENT");}
122 { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , NULL , NULL, 0); }
125 { ECPGdisconnect(__LINE__, "CURRENT");}
130 { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/nonexistant" , "connectuser" , "connectpw" , NULL, 0); }
133 { ECPGdisconnect(__LINE__, "CURRENT");}
138 { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:20/connectdb" , "connectuser" , "connectpw" , NULL, 0); }
141 /* no disconnect necessary */
144 { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , "wrongpw" , NULL, 0); }
147 /* no disconnect necessary */