kjk;ok code example
Example 1: kjk;ok
void PQfinish(PGconn *conn);
Example 2: kjk;ok
PQconninfoOption *PQconninfoParse(const char *conninfo, char **errmsg);
Example 3: kjk;ok
switch(PQstatus(conn))
{
case CONNECTION_STARTED:
feedback = "Connecting...";
break;
case CONNECTION_MADE:
feedback = "Connected to server...";
break;
.
.
.
default:
feedback = "Connecting...";
}
Example 4: kjk;ok
PQconninfoOption *PQconninfo(PGconn *conn);
Example 5: kjk;ok
PGconn *PQconnectStartParams(const char * const *keywords,
const char * const *values,
int expand_dbname);
PGconn *PQconnectStart(const char *conninfo);
PostgresPollingStatusType PQconnectPoll(PGconn *conn);
Example 6: kjk;ok
PQconninfoOption *PQconndefaults(void);
typedef struct
{
char *keyword; /* The keyword of the option */
char *envvar; /* Fallback environment variable name */
char *compiled; /* Fallback compiled in default value */
char *val; /* Option's current value, or NULL */
char *label; /* Label for field in connect dialog */
char *dispchar; /* Indicates how to display this field
in a connect dialog. Values are:
"" Display entered value as is
"*" Password field - hide value
"D" Debug option - don't show by default */
int dispsize; /* Field size in characters for dialog */
} PQconninfoOption;
Example 7: kjk;ok
PGconn *PQsetdb(char *pghost,
char *pgport,
char *pgoptions,
char *pgtty,
char *dbName);
Example 8: kjk;ok
PGconn *PQsetdbLogin(const char *pghost,
const char *pgport,
const char *pgoptions,
const char *pgtty,
const char *dbName,
const char *login,
const char *pwd);
Example 9: kjk;ok
PGconn *PQconnectdb(const char *conninfo);
Example 10: kjk;ok
PGconn *PQconnectdbParams(const char * const *keywords,
const char * const *values,
int expand_dbname);