diff options
| author | Tom Lane | 2003-05-05 00:44:56 +0000 |
|---|---|---|
| committer | Tom Lane | 2003-05-05 00:44:56 +0000 |
| commit | 16503e6fa4a13051debe09698b6db9ce0d509af8 (patch) | |
| tree | b8165b6e9481ec187aee0b54f0cb722915d1090a /src/interfaces/libpq | |
| 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')
| -rw-r--r-- | src/interfaces/libpq/fe-connect.c | 13 | ||||
| -rw-r--r-- | src/interfaces/libpq/libpq-int.h | 4 |
2 files changed, 14 insertions, 3 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') diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index a5e6bceef42..3fcecd63e23 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: libpq-int.h,v 1.66 2003/04/26 20:23:00 tgl Exp $ + * $Id: libpq-int.h,v 1.67 2003/05/05 00:44:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -56,7 +56,7 @@ typedef int ssize_t; /* ssize_t doesn't exist in VC (atleast * pqcomm.h describe what the backend knows, not what libpq knows. */ -#define PG_PROTOCOL_LIBPQ PG_PROTOCOL(3,105) /* XXX temporary value */ +#define PG_PROTOCOL_LIBPQ PG_PROTOCOL(3,106) /* XXX temporary value */ /* * POSTGRES backend dependent Constants. |
