pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #18850: REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison
2+ messages / 2 participants
[nested] [flat]

* BUG #18850: REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison
@ 2025-03-14 09:16  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2025-03-14 09:16 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: pm91.arapov@gmail.com

The following bug has been logged on the website:

Bug reference:      18850
Logged by:          Nikita
Email address:      pm91.arapov@gmail.com
PostgreSQL version: 16.6
Operating system:   ubuntu 20.04
Description:        

REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison

diff --git a/src/backend/commands/operatorcmds.c
b/src/backend/commands/operatorcmds.c
--- a/src/backend/commands/operatorcmds.c	(revision
a49ac80219c6f28c3cf3973f797de637329952da)
+++ b/src/backend/commands/operatorcmds.c	(date 1740387217614)
@@ -209,11 +209,6 @@
 		typeId[0] = typeId2;
 		nargs = 1;
 	}
-	else if (!OidIsValid(typeId2))
-	{
-		typeId[0] = typeId1;
-		nargs = 1;
-	}
 	else
 	{
 		typeId[0] = typeId1;

I suggest the following patch fixing this issue



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #18850: REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison
@ 2025-03-14 14:32  Tom Lane <tgl@sss.pgh.pa.us>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2025-03-14 14:32 UTC (permalink / raw)
  To: pm91.arapov@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org

PG Bug reporting form <noreply@postgresql.org> writes:
> REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison

Let's see, in #18848 and #18849 you were complaining about
non-robust code, but here you want to remove robustness?
I think it's fine as-is.  (The back story here is that we
used to support postfix operators, so the earlier error
for !OidIsValid(typeId2) postdates this bit.  While I don't
think that support is ever coming back, I'm disinclined to
remove a couple of lines that would be important for it.)

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-03-14 14:32 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-03-14 09:16 BUG #18850: REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison PG Bug reporting form <noreply@postgresql.org>
2025-03-14 14:32 ` Tom Lane <tgl@sss.pgh.pa.us>

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