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");
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");
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();
**
*/
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);
*/
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,...);