Re: BUG #16049: log_line_prefix=%a and log_connections - application_name missing

From: death lock <deathlock13(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16049: log_line_prefix=%a and log_connections - application_name missing
Date: 2019-10-15 12:34:40
Message-ID: CAO5GjwHNmawCgbSiG22UdV8MBtHtL91M83THgZDa4tGHhsBfHg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"will do what you want." Not exactly - I want it to appear according
to my log_line_prefix - 4 ex. ='%t|%p|%a|%d|%u|%h| '
I've used that patch on 9.5.19

In elog.c there's : const char *appname = application_name; // line 2357
other cases have : const char *username = MyProcPort->user_name;
After adding 'MyProcPort->' to %a case '|psql|' shows up like I
wanted .. but connection process Segfaults :/

I've tracked it to postinit.c - process_startup_options() - this loop
: while (gucopts) {...}

gucopts = list_head(port->guc_options);
ereport(LOG, (errmsg(" +++ process_startup_options : [%s] ",
gucopts))); // adding this line returns :

2019-10-15 14:28:03 CEST|9760|psql|postgres|postgres|[local]|
LOCATION: PerformAuthentication, postinit.c:257
2019-10-15 14:28:03 CEST|9760|psql|postgres|postgres|[local]| LOG:
00000: +++ process_startup_options : [local all
all trust]
2019-10-15 14:28:03 CEST|9760|psql|postgres|postgres|[local]|
LOCATION: process_startup_options, postinit.c:1066

Sorry 4 nagging , any pointers much appreciated

On 10/11/19, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> This was changed about a year ago, see
>
> https://www.postgresql.org/message-id/flat/CAHJZqBB_Pxv8HRfoh%2BAB4KxSQQuPVvtYCzMg7woNR3r7dfmopw%40mail.gmail.com
>
> so v12 will do what you want.
>
> regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-10-15 13:11:29 BUG #16059: Tab-completion of filenames in COPY commands removes required quotes
Previous Message PG Bug reporting form 2019-10-15 08:26:00 BUG #16058: show session_user shows a not clear error message