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) ...@@ -27,7 +27,7 @@ main(int argc, char **argv)
if (argc != 2) if (argc != 2)
halt("Usage: %s database\n", argv[0]); halt("Usage: %s database\n", argv[0]);
connectdb(argv[1], NULL, NULL, NULL, NULL); connectdb(NULL, NULL, NULL, NULL, argv[1]);
on_error_continue(); on_error_continue();
doquery("DROP TABLE testfetch"); doquery("DROP TABLE testfetch");
......
...@@ -38,7 +38,7 @@ main(int argc, char **argv) ...@@ -38,7 +38,7 @@ main(int argc, char **argv)
if (argc != 2) if (argc != 2)
halt("Usage: %s database\n", argv[0]); halt("Usage: %s database\n", argv[0]);
connectdb(argv[1], NULL, NULL, NULL, NULL); connectdb(NULL, NULL, NULL, NULL, argv[1]);
on_error_continue(); on_error_continue();
doquery("DROP TABLE testfetch"); doquery("DROP TABLE testfetch");
......
...@@ -19,7 +19,7 @@ main(int argc, char **argv) ...@@ -19,7 +19,7 @@ main(int argc, char **argv)
if (argc != 2) if (argc != 2)
halt("Usage: %s database\n", argv[0]); halt("Usage: %s database\n", argv[0]);
connectdb(argv[1], NULL, NULL, NULL, NULL); connectdb(NULL, NULL, NULL, NULL, argv[1]);
on_error_continue(); on_error_continue();
doquery("DROP TABLE words"); doquery("DROP TABLE words");
on_error_stop(); on_error_stop();
......
...@@ -42,11 +42,11 @@ static int tuple; ...@@ -42,11 +42,11 @@ static int tuple;
** **
*/ */
PGconn * PGconn *
connectdb(char *dbName, connectdb(char *pghost,
char *pghost,
char *pgport, char *pgport,
char *pgoptions, char *pgoptions,
char *pgtty) char *pgtty,
char *dbName)
{ {
/* make a connection to the database */ /* make a connection to the database */
conn = PQsetdb(pghost, pgport, pgoptions, pgtty, dbName); conn = PQsetdb(pghost, pgport, pgoptions, pgtty, dbName);
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
*/ */
PGresult *doquery(char *query); PGresult *doquery(char *query);
PGconn *connectdb(char *dbName, PGconn *connectdb(char *pghost,
char *pghost,
char *pgport, char *pgport,
char *pgoptions, char *pgoptions,
char *pgtty); char *pgtty,
char *dbName);
void disconnectdb(void); void disconnectdb(void);
int fetch(void *param,...); int fetch(void *param,...);
int fetchwithnulls(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