+
+
+
+ Returns the service of the active connection.
+
+
+char *PQservice(const PGconn *conn);
+
+
+
+ returns NULL if the
+ Otherwise, if there was no service provided, it returns an empty string.
+
+
+
+
static const internalPQconninfoOption PQconninfoOptions[] = {
{"service", "PGSERVICE", NULL, NULL,
- "Database-Service", "", 20, -1},
+ "Database-Service", "", 20,
+ offsetof(struct pg_conn, pgservice)},
{"user", "PGUSER", NULL, NULL,
"Database-User", "", 20,
return conn->dbName;
}
+char *
+PQservice(const PGconn *conn)
+{
+ if (!conn)
+ return NULL;
+ return conn->pgservice;
+}
+
char *
PQuser(const PGconn *conn)
{
/* Accessor functions for PGconn objects */
extern char *PQdb(const PGconn *conn);
+extern char *PQservice(const PGconn *conn);
extern char *PQuser(const PGconn *conn);
extern char *PQpass(const PGconn *conn);
extern char *PQhost(const PGconn *conn);
char *fbappname; /* fallback application name */
char *dbName; /* database name */
char *replication; /* connect as the replication standby? */
+ char *pgservice; /* Postgres service, if any */
char *pguser; /* Postgres username and password, if any */
char *pgpass;
char *pgpassfile; /* path to a file containing password(s) */