pgsql: Add application_name to connection authorized msg

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add application_name to connection authorized msg
Date: 2018-09-28 23:05:50
Message-ID: E1g61pW-0002dS-31@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)seiler(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-09-30 17:55:57 pgsql: Create an RTE field to record the query's lock mode for each rel
Previous Message Tom Lane 2018-09-28 20:12:19 pgsql: Improve error reporting for unsupported effective_io_concurrency