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-16 11:42:20
Message-ID: CAO5GjwGKBR5bg+T8PjrS5Q1zVqa1HuLu6e5AFL39hGtmZpbZZQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Not sure where I messed up yesterday , slimmed patch in attachment

--- postgresql-9.5.19/src/backend/utils/error/elog.c
+++ postgresql-9.5.19/src/backend/utils/error/elog.c
@@ -2354,7 +2354,9 @@
case 'a':
if (MyProcPort)
{
- const char *appname = application_name;
+
+ // ereport(LOG, (errmsg(" ++ MyProcPort : [%s] ", application_name)));
+ const char *appname = MyProcPort->application_name;

adding 'MyProcPort->' works great for me
1. why appname =application_name doesn't produce err , but trying to
print application_name value -> SegFault ?

Attachment Content-Type Size
pg95appname.patch text/x-patch 2.1 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-10-16 12:27:57 Re: BUG #16045: vacuum_db crash and illegal memory alloc after pg_upgrade from PG11 to PG12
Previous Message Tomas Vondra 2019-10-16 11:33:44 Re: BUG #16045: vacuum_db crash and illegal memory alloc after pg_upgrade from PG11 to PG12