diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-12-02 04:54:10 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-12-02 04:54:10 +0000 |
commit | 59ed94ad0c9f74a3f057f359316c845cedc4461e (patch) | |
tree | 0f52806e51b9741b5b95d7f0a45aa24c7b5a0c7e | |
parent | 3dfcf8cc15aeae3d30a0470b7d6bd5d4d462805d (diff) |
Mark application_name as GUC_REPORT so that the value will be reported back
to the client by the server. This might seem pretty pointless but apparently
it will help pgbouncer, and perhaps other connection poolers. Anyway it's
practically free to do so for the normal use-case where appname is only set
in the startup packet --- we're just adding a few more bytes to the initial
ParameterStatus response packet. Per comments from Marko Kreen.
-rw-r--r-- | doc/src/sgml/libpq.sgml | 8 | ||||
-rw-r--r-- | doc/src/sgml/protocol.sgml | 8 | ||||
-rw-r--r-- | src/backend/utils/misc/guc.c | 4 |
3 files changed, 12 insertions, 8 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index b93e381b1e6..95c903378ca 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.290 2009/11/28 23:38:06 tgl Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.291 2009/12/02 04:54:10 tgl Exp $ --> <chapter id="libpq"> <title><application>libpq</application> - C Library</title> @@ -1167,6 +1167,7 @@ PQconninfoOption *PQconninfoParse(const char *conninfo, char **errmsg); <literal>server_version</>, <literal>server_encoding</>, <literal>client_encoding</>, + <literal>application_name</>, <literal>is_superuser</>, <literal>session_authorization</>, <literal>DateStyle</>, @@ -1177,8 +1178,9 @@ PQconninfoOption *PQconninfoParse(const char *conninfo, char **errmsg); (<literal>server_encoding</>, <literal>TimeZone</>, and <literal>integer_datetimes</> were not reported by releases before 8.0; <literal>standard_conforming_strings</> was not reported by releases - before 8.1; <literal>IntervalStyle</> was not reported by releases - before 8.4.) + before 8.1; + <literal>IntervalStyle</> was not reported by releases before 8.4; + <literal>application_name</> was not reported by releases before 8.5.) Note that <literal>server_version</>, <literal>server_encoding</> and diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 3b115fec430..1ec079e41c8 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/protocol.sgml,v 1.75 2008/11/09 00:28:34 tgl Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/protocol.sgml,v 1.76 2009/12/02 04:54:10 tgl Exp $ --> <chapter id="protocol"> <title>Frontend/Backend Protocol</title> @@ -1088,6 +1088,7 @@ <literal>server_version</>, <literal>server_encoding</>, <literal>client_encoding</>, + <literal>application_name</>, <literal>is_superuser</>, <literal>session_authorization</>, <literal>DateStyle</>, @@ -1098,8 +1099,9 @@ (<literal>server_encoding</>, <literal>TimeZone</>, and <literal>integer_datetimes</> were not reported by releases before 8.0; <literal>standard_conforming_strings</> was not reported by releases - before 8.1; <literal>IntervalStyle</> was not reported by releases - before 8.4.) + before 8.1; + <literal>IntervalStyle</> was not reported by releases before 8.4; + <literal>application_name</> was not reported by releases before 8.5.) Note that <literal>server_version</>, <literal>server_encoding</> and diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 04ba14c2dbb..f5db7783f19 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -10,7 +10,7 @@ * Written by Peter Eisentraut <peter_e@gmx.net>. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.524 2009/11/28 23:38:07 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.525 2009/12/02 04:54:10 tgl Exp $ * *-------------------------------------------------------------------- */ @@ -2541,7 +2541,7 @@ static struct config_string ConfigureNamesString[] = {"application_name", PGC_USERSET, LOGGING, gettext_noop("Sets the application name to be reported in statistics and logs."), NULL, - GUC_IS_NAME | GUC_NOT_IN_SAMPLE + GUC_IS_NAME | GUC_REPORT | GUC_NOT_IN_SAMPLE }, &application_name, "", assign_application_name, NULL |