On Sat, Oct 25, 2008 at 11:59 AM, Robert Haas <[EMAIL PROTECTED]> wrote:

> > I really think we should have a way of telling if a array/row/record
> > variable is actually set to something, and I'm pretty sure that should be
> > unrelated to whether all the elements in it happen to be null.
>
> +1.  Also, can whatever syntax we introduce by something relatively
> concise?  Code that looks nice when you write "=" does not look as
> nice when you write "IS NOT DISTINCT FROM".  I'm almost inclined to
> suggest using functional notation rather than dreaming up a new "IS
> WHATEVER" syntax.


I've always thought that IS should be used for this. That is:

x IS y

is equivalent to

x=y OR (x IS NULL AND y IS NULL)

and

x IS NOT y

is equivalent to

x <> y AND (x IS NOT NULL OR y IS NOT NULL)

If you define the IS operator like this then IS NULL is no longer an
operator. It is just the IS operator with the NULL literal as the second
operand.

Reply via email to