RE: Allow escape in application_name - Mailing list pgsql-hackers

From kuroda.hayato@fujitsu.com
Subject RE: Allow escape in application_name
Date
Msg-id TYAPR01MB5866684DFB90784D2EE0BDB4F56E9@TYAPR01MB5866.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Allow escape in application_name  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Allow escape in application_name
List pgsql-hackers
Dear Horiguchi-san

Thank you for giving comments! I attached new patches.

> > +                    if (appname == NULL)
> > +                        appname = "[unknown]";
> > +                    if (username == NULL || *username
> == '\0')
> > +                        username = "[unknown]";
> > +                    if (dbname == NULL || *dbname ==
> '\0')
> > +                        dbname =  "[unknown]";
> >
> > I'm still not sure why these are necessary. Could you clarify that?
>
> It probably comes from my request, just for safety for uncertain
> future.  They are actually not needed under the current usage of the
> function, so *I* would not object to removing them if you are strongly
> feel them out of place.  In that case, since NULL's leads to SEGV
> outright, we would even not need assertions instead.

Yeah, I followed your suggestion. But we deiced to keep codes clean,
hence I removed the if-statements.

Best Regards,
Hayato Kuroda
FUJITSU LIMITED


Attachment

pgsql-hackers by date:

Previous
From: "曾文旌(义从)"
Date:
Subject: 回复:Re: Is it worth pushing conditions to sublink/subplan?
Next
From: Amit Kapila
Date:
Subject: Re: Alter all tables in schema owner fix