diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-05-05 00:44:56 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-05-05 00:44:56 +0000 |
commit | 16503e6fa4a13051debe09698b6db9ce0d509af8 (patch) | |
tree | b8165b6e9481ec187aee0b54f0cb722915d1090a /src/interfaces/libpq/fe-connect.c | |
parent | a59793f82c8bb7d9931dab8675d91e06c1a41f5a (diff) |
Extended query protocol: parse, bind, execute, describe FE/BE messages.
Only lightly tested as yet, since libpq doesn't know anything about 'em.
Diffstat (limited to 'src/interfaces/libpq/fe-connect.c')
-rw-r--r-- | src/interfaces/libpq/fe-connect.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 3bf27da4278..75bcb43433b 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.239 2003/04/28 04:52:13 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.240 2003/05/05 00:44:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -376,6 +376,17 @@ static bool connectOptions2(PGconn *conn) { /* + * If database name was not given, default it to equal user name + */ + if ((conn->dbName == NULL || conn->dbName[0] == '\0') + && conn->pguser != NULL) + { + if (conn->dbName) + free(conn->dbName); + conn->dbName = strdup(conn->pguser); + } + + /* * Supply default password if none given */ if (conn->pgpass == NULL || conn->pgpass[0] == '\0') |