aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/libpq-int.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-11-28 23:38:08 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-11-28 23:38:08 +0000
commit8217cfbd991856d25d73b0f7afcf43d99f90b653 (patch)
tree46538428417fcd360d976a151d87cee402a878be /src/interfaces/libpq/libpq-int.h
parentcb98f615383ccf2f9f339b4e812b23e840b12d9f (diff)
downloadpostgresql-8217cfbd991856d25d73b0f7afcf43d99f90b653.tar.gz
postgresql-8217cfbd991856d25d73b0f7afcf43d99f90b653.zip
Add support for an application_name parameter, which is displayed in
pg_stat_activity and recorded in log entries. Dave Page, reviewed by Andres Freund
Diffstat (limited to 'src/interfaces/libpq/libpq-int.h')
-rw-r--r--src/interfaces/libpq/libpq-int.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h
index d93ba4d25e2..a496aebbba3 100644
--- a/src/interfaces/libpq/libpq-int.h
+++ b/src/interfaces/libpq/libpq-int.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.144 2009/07/24 17:58:31 tgl Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.145 2009/11/28 23:38:08 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -244,6 +244,14 @@ typedef enum
SETENV_STATE_IDLE
} PGSetenvStatusType;
+/* PGAppnameStatusType defines the state of the PQAppname state machine */
+typedef enum
+{
+ APPNAME_STATE_CMD_SEND, /* About to send the appname */
+ APPNAME_STATE_CMD_WAIT, /* Waiting for above send to complete */
+ APPNAME_STATE_IDLE
+} PGAppnameStatusType;
+
/* Typedef for the EnvironmentOptions[] array */
typedef struct PQEnvironmentOption
{
@@ -295,6 +303,8 @@ struct pg_conn
* displayed (OBSOLETE, NOT USED) */
char *connect_timeout; /* connection timeout (numeric string) */
char *pgoptions; /* options to start the backend with */
+ char *appname; /* application name */
+ char *fbappname; /* fallback application name */
char *dbName; /* database name */
char *pguser; /* Postgres username and password, if any */
char *pgpass;
@@ -349,6 +359,7 @@ struct pg_conn
struct addrinfo *addr_cur; /* the one currently being tried */
int addrlist_family; /* needed to know how to free addrlist */
PGSetenvStatusType setenv_state; /* for 2.0 protocol only */
+ PGAppnameStatusType appname_state;
const PQEnvironmentOption *next_eo;
/* Miscellaneous stuff */