Re: [PATCH] psql : Improve code for help option
Fujii Masao <masao.fujii@oss.nttdata.com>
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: miyake_kouta <miyake_kouta@oss.nttdata.com>,
Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2021-03-02T15:09:18Z
Lists: pgsql-hackers
On 2021/03/02 11:57, miyake_kouta wrote:
> Hi.
>
> I found some redundant code in psql/help.c, so I propose a patch to fix it.
> In the current help.c, the variable "user" is set to the value of $PGUSER (or get_user_name).
> However, $PGUSER is referenced again in the code that follows.
> We can replace this part with "user", I think.
Good catch!
> fprintf(output, _(" -U, --username=USERNAME database user name (default: \"%s\")\n"), env);
We can simplify the code more and remove "env = user"
by just using "user" instead of "env" in the above?
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Commits
-
Remove redundant getenv() for PGUSER, in psql help.
- 4a4241e15b24 14.0 landed