From: Bruce Momjian Date: Fri, 28 Apr 2000 14:58:51 +0000 (+0000) Subject: Change libpgeasy to take dbname at end like all other interfaces. X-Git-Tag: REL7_0~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7aa443d01e3daede2e8926865eebe14fe9a61997;p=postgresql Change libpgeasy to take dbname at end like all other interfaces. --- diff --git a/src/interfaces/libpgeasy/examples/pginsert.c b/src/interfaces/libpgeasy/examples/pginsert.c index 5fa96bf474..18b5382ede 100644 --- a/src/interfaces/libpgeasy/examples/pginsert.c +++ b/src/interfaces/libpgeasy/examples/pginsert.c @@ -27,7 +27,7 @@ main(int argc, char **argv) if (argc != 2) halt("Usage: %s database\n", argv[0]); - connectdb(argv[1], NULL, NULL, NULL, NULL); + connectdb(NULL, NULL, NULL, NULL, argv[1]); on_error_continue(); doquery("DROP TABLE testfetch"); diff --git a/src/interfaces/libpgeasy/examples/pgnulltest.c b/src/interfaces/libpgeasy/examples/pgnulltest.c index f54a3f5916..da88efbbe4 100644 --- a/src/interfaces/libpgeasy/examples/pgnulltest.c +++ b/src/interfaces/libpgeasy/examples/pgnulltest.c @@ -38,7 +38,7 @@ main(int argc, char **argv) if (argc != 2) halt("Usage: %s database\n", argv[0]); - connectdb(argv[1], NULL, NULL, NULL, NULL); + connectdb(NULL, NULL, NULL, NULL, argv[1]); on_error_continue(); doquery("DROP TABLE testfetch"); diff --git a/src/interfaces/libpgeasy/examples/pgwordcount.c b/src/interfaces/libpgeasy/examples/pgwordcount.c index c5705e87fa..08138510ea 100644 --- a/src/interfaces/libpgeasy/examples/pgwordcount.c +++ b/src/interfaces/libpgeasy/examples/pgwordcount.c @@ -19,7 +19,7 @@ main(int argc, char **argv) if (argc != 2) halt("Usage: %s database\n", argv[0]); - connectdb(argv[1], NULL, NULL, NULL, NULL); + connectdb(NULL, NULL, NULL, NULL, argv[1]); on_error_continue(); doquery("DROP TABLE words"); on_error_stop(); diff --git a/src/interfaces/libpgeasy/libpgeasy.c b/src/interfaces/libpgeasy/libpgeasy.c index c2efe034c4..41d3d0429c 100644 --- a/src/interfaces/libpgeasy/libpgeasy.c +++ b/src/interfaces/libpgeasy/libpgeasy.c @@ -42,11 +42,11 @@ static int tuple; ** */ PGconn * -connectdb(char *dbName, - char *pghost, +connectdb(char *pghost, char *pgport, char *pgoptions, - char *pgtty) + char *pgtty, + char *dbName) { /* make a connection to the database */ conn = PQsetdb(pghost, pgport, pgoptions, pgtty, dbName); diff --git a/src/interfaces/libpgeasy/libpgeasy.h b/src/interfaces/libpgeasy/libpgeasy.h index e58d5a1cd6..3686b4e926 100644 --- a/src/interfaces/libpgeasy/libpgeasy.h +++ b/src/interfaces/libpgeasy/libpgeasy.h @@ -4,11 +4,11 @@ */ PGresult *doquery(char *query); -PGconn *connectdb(char *dbName, - char *pghost, +PGconn *connectdb(char *pghost, char *pgport, char *pgoptions, - char *pgtty); + char *pgtty, + char *dbName); void disconnectdb(void); int fetch(void *param,...); int fetchwithnulls(void *param,...);