From: Stephen Frost <sfrost@snowman.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add application_name to connection authorized msg
Date: Fri, 28 Sep 2018 23:05:50 +0000
Message-ID: <E1g61pW-0002dS-31@gemulon.postgresql.org> (raw)
Add application_name to connection authorized msg
The connection authorized message has quite a bit of useful information
in it, but didn't include the application_name (when provided), so let's
add that as it can be very useful.
Note that at the point where we're emitting the connection authorized
message, we haven't processed GUCs, so it's not possible to get this by
using log_line_prefix (which pulls from the GUC). There's also
something to be said for having this included in the connection
authorized message and then not needing to repeat it for every line, as
having it in log_line_prefix would do.
The GUC cleans the application name to pure-ascii, so do that here too,
but pull out the logic for cleaning up a string into its own function
in common and re-use it from those places, and check_cluster_name which
was doing the same thing.
Author: Don Seiler <don@seiler.us>
Discussion: https://postgr.es/m/CAHJZqBB_Pxv8HRfoh%2BAB4KxSQQuPVvtYCzMg7woNR3r7dfmopw%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/8bddc864000f56d396621d4ad0f13e8e1872ddf5
Modified Files
--------------
src/backend/postmaster/postmaster.c | 16 +++++++++++
src/backend/utils/init/postinit.c | 54 ++++++++++++++++++++++++++-----------
src/backend/utils/misc/guc.c | 17 +++---------
src/common/string.c | 34 +++++++++++++++++++++++
src/include/common/string.h | 1 +
src/include/libpq/libpq-be.h | 7 +++++
6 files changed, 99 insertions(+), 30 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: sfrost@snowman.net
Subject: Re: pgsql: Add application_name to connection authorized msg
In-Reply-To: <E1g61pW-0002dS-31@gemulon.postgresql.org>
References: <E1g61pW-0002dS-31@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox