21 main(
int argc,
char **argv)
38 conninfo =
"dbname = postgres";
52 "SELECT pg_catalog.set_config('search_path', '', false)");
86 res =
PQexec(
conn,
"DECLARE myportal CURSOR FOR select * from pg_database");
105 for (
i = 0;
i < nFields;
i++)
112 for (
j = 0;
j < nFields;
j++)
static void PGresult * res
char * PQerrorMessage(const PGconn *conn)
ConnStatusType PQstatus(const PGconn *conn)
void PQfinish(PGconn *conn)
PGconn * PQconnectdb(const char *conninfo)
ExecStatusType PQresultStatus(const PGresult *res)
int PQntuples(const PGresult *res)
char * PQfname(const PGresult *res, int field_num)
PGresult * PQexec(PGconn *conn, const char *query)
char * PQgetvalue(const PGresult *res, int tup_num, int field_num)
int PQnfields(const PGresult *res)
static void exit_nicely(PGconn *conn)
int main(int argc, char **argv)