Re: != should give error? - Mailing list pgsql-hackers

From ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Subject Re: != should give error?
Date
Msg-id d8j1sjoxff1.fsf@dalvik.ping.uio.no
Whole thread Raw
In response to Re: != should give error?  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: != should give error?  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

> Mikael Kjellström wrote:
>
>> BTW isn't the "preferred" way of writing different from / not equal in SQL
>> to use the <> operator?
>
> Yes, <> is the operator mandated by the SQL standard.  I don't think !=
> appears anywhere -- it's our extension only and thus if you use it you
> should not expect your applications to work on other DBMSs.

It seems to be supported work on all the DBMSs supported by sqlfiddle.com,
i.e. Oracle, MySQL, PostgreSQL, SQLite and MS SQL Server.

The DB2 documentation¹ says it's supported (it even supports ¬=, and
negating < and >, not just =).

Firebird² also supports it, in addition to ~= and ^= (and it also
supports negating < and >).

So while it might not be standard SQL, it's definitely not "our
extension only".

[1] https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/sqlp/rbafycompop.htm
[2]
https://www.firebirdsql.org/file/documentation/reference_manuals/fblangref25-en/html/fblangref25-commons-expressions.html#fblangref25-dtyp-tbl-comparpreced

- ilmari
-- 
"A disappointingly low fraction of the human race is,
 at any given time, on fire." - Stig Sandbeck Mathisen


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: ddd
Next
From: Alvaro Herrera
Date:
Subject: Re: != should give error?