Re: BUG #18689: psql : operator "!=" do not behave like "<>" - Mailing list pgsql-bugs

From Rafia Sabih
Subject Re: BUG #18689: psql : operator "!=" do not behave like "<>"
Date
Msg-id CA+FpmFfh6r4Zqae01SV1Sk0kNG9h0zaSeMTbsg6=6FS8VL6FFQ@mail.gmail.com
Whole thread Raw
In response to BUG #18689: psql : operator "!=" do not behave like "<>"  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18689: psql : operator "!=" do not behave like "<>"
Re: BUG #18689: psql : operator "!=" do not behave like "<>"
List pgsql-bugs
Thank you for reporting this. However I found that the lack of space in the statement is causing this.
On trying it like select -1 != -1; it works fine.

On Tue, 5 Nov 2024 at 13:39, PG Bug reporting form <noreply@postgresql.org> wrote:
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.



--
Regards,
Rafia Sabih
CYBERTEC PostgreSQL International GmbH

pgsql-bugs by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: BUG #18688: _LSOpenURLsWithCompletionHandler() failed with error -54. (1)
Next
From: Tom Lane
Date:
Subject: Re: BUG #18689: psql : operator "!=" do not behave like "<>"