Commit 7aa443d0 authored by Bruce Momjian's avatar Bruce Momjian

Change libpgeasy to take dbname at end like all other interfaces.

parent 796695c9
......@@ -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");
......
......@@ -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");
......
......@@ -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();
......
......@@ -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);
......
......@@ -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,...);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment