From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Richard Guo <guofenglinux@gmail.com>
Cc: RekGRpth <rekgrpth@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18230: Redundant comparison of a local variable 'tzp' address with a NULL value at dt_common.c
Date: Wed, 06 Dec 2023 23:05:04 -0500
Message-ID: <1196403.1701921904@sss.pgh.pa.us> (raw)
In-Reply-To: <ZXEuwRR0Sq012eiu@paquier.xyz>
References: <18230-c68eb05e05cb9177@postgresql.org>
<da26cdf3558c605244838ca899c96c8874bbe92d.camel@cybertec.at>
<CAPgh2mJJ7XrHTWSnYEb92R4PoknrqopOKDe6+795=v3q1aD6Eg@mail.gmail.com>
<51a453dfe23d1b7f33c2d9b495a4c6eb972da61e.camel@cybertec.at>
<CAPgh2mKi8t8T7Tsqx-EwSMYG_xYQQSY30qp18sH8dVySP4Fmdg@mail.gmail.com>
<CAMbWs48z_7Vc8_Q93QEuUaB6n3-rJPO0f8KF=gbogzTmK4hvpA@mail.gmail.com>
<ZXEuwRR0Sq012eiu@paquier.xyz>
Michael Paquier <michael@paquier.xyz> writes:
> *tzp could be given to DecodeTimezone() and manipulated inside it, but
> you are right that we don't use it at all in the DecodeDateTime()
> path. Other callers of DecodeTimezone() may depend on the changes
> done inside it, though. Perhaps DecodeTimezone() should be extended
> so as it can accept a NULL value and use that in DecodeDateTime(),
> eliminating the need for *tzp entirely?
TBH, I think our best path here is to leave well enough alone.
The main impact of the proposed changes is to make ecpg's copy
of the datetime parsing code diverge even further from the
backend's copy. I don't think that these changes buy anything
meaningful, and what they will do is make it harder to reunify
that logic, which somebody will probably try to do someday.
(The recent changes to support non-error-throwing returns from
input functions probably made that task notably easier, BTW.)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, guofenglinux@gmail.com, rekgrpth@gmail.com, laurenz.albe@cybertec.at, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18230: Redundant comparison of a local variable 'tzp' address with a NULL value at dt_common.c
In-Reply-To: <1196403.1701921904@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox