pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: jhecht@cirilgroup.com
Subject: BUG #18689: psql : operator "!=" do not behave like "<>"
Date: Tue, 05 Nov 2024 11:23:57 +0000
Message-ID: <18689-7af3dd324b42205d@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18689
Logged by:          Joël HECHT
Email address:      jhecht@cirilgroup.com
PostgreSQL version: 15.6
Operating system:   CentOS Linux release 7.9
Description:        

Hello,

according to the documentation, operators != and <> are supposed to be
interchangeable.
But when operator "!=" is followed by a negative number, the request failed
with an error "No operator matches the given name".

Here is how to reproduce the issue directly with psql :


[postgres@d04f96727d36 ~]$ psql
psql (15.6)
Type "help" for help.

postgres=# select -1<>-1;
 ?column?
----------
 f
(1 row)

postgres=# select -1!=-1;
ERROR:  operator does not exist: integer !=- integer
LINE 1: select -1!=-1;
                 ^
HINT:  No operator matches the given name and argument types. You might need
to add explicit type casts.
postgres=#


Regards.



view thread (4+ messages)  latest in thread

Message-ID: <18689-7af3dd324b42205d@postgresql.org>
Permalink:  ../18689-7af3dd324b42205d@postgresql.org/
Also on:    postgresql.org/message-id/18689-7af3dd324b42205d@postgresql.org

 · 

reply

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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, jhecht@cirilgroup.com
  Subject: Re: BUG #18689: psql : operator "!=" do not behave like "<>"
  In-Reply-To: <18689-7af3dd324b42205d@postgresql.org>

* 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