IS DISTINCT FROM vs. ANY

Started by David Fetterabout 16 years ago2 messages
#1David Fetter
david@fetter.org

Folks,

Shouldn't this work and produce a "true?"

SELECT NULL IS NOT DISTINCT FROM ANY(ARRAY['a',NULL]);
ERROR: syntax error at or near "ANY"
LINE 1: SELECT NULL IS NOT DISTINCT FROM ANY(ARRAY['a',NULL]);

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#2Richard Huxton
dev@archonet.com
In reply to: David Fetter (#1)
Re: IS DISTINCT FROM vs. ANY

David Fetter wrote:

Folks,

Shouldn't this work and produce a "true?"

SELECT NULL IS NOT DISTINCT FROM ANY(ARRAY['a',NULL]);
ERROR: syntax error at or near "ANY"
LINE 1: SELECT NULL IS NOT DISTINCT FROM ANY(ARRAY['a',NULL]);

It should, but probably depends on whether "IS NOT DISTINCT" should be
considered an "operator".

http://www.postgresql.org/docs/8.4/static/functions-comparisons.html#AEN16561

Got caught by the same thing a couple of days ago.

--
Richard Huxton
Archonet Ltd