Re: BUG #18230: Redundant comparison of a local variable 'tzp' address with a NULL value at dt_common.c - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18230: Redundant comparison of a local variable 'tzp' address with a NULL value at dt_common.c
Date
Msg-id 1196403.1701921904@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #18230: Redundant comparison of a local variable 'tzp' address with a NULL value at dt_common.c  (Michael Paquier <michael@paquier.xyz>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: Andrei Lepikhov
Date:
Subject: Re: BUG #18187: Unexpected error: "variable not found in subplan target lists" triggered by JOIN
Next
From: PG Bug reporting form
Date:
Subject: BUG #18231: String conversion function is adding special characters in Postgres 15