Re: !<space>= should give error?

From: ilmari(at)ilmari(dot)org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=)
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Mikael Kjellström <mikael(dot)kjellstrom(at)mksoft(dot)nu>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: !<space>= should give error?
Date: 2017-12-21 15:35:14
Message-ID: d8j1sjoxff1.fsf@dalvik.ping.uio.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2017-12-21 15:42:33 Re: !<space>= should give error?
Previous Message Robert Haas 2017-12-21 15:35:06 Re: ddd