Change libpgeasy to take dbname at end like all other interfaces.
This commit is contained in:
parent
796695c9d1
commit
7aa443d01e
@ -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,...);
|
||||
|
Loading…
Reference in New Issue
Block a user