Re: Differences in WHERE clause of SELECT - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Differences in WHERE clause of SELECT
Date
Msg-id 12805.1373990700@sss.pgh.pa.us
Whole thread Raw
In response to Re: Differences in WHERE clause of SELECT  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Differences in WHERE clause of SELECT
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I continue to be of the opinion that our behavior in this area is
> bone-headed.  It's reasonable to reject integer = character varying on
> the basis that we don't know whether integer or character varying
> comparison semantics are wanted, and the two might give different
> answers (think: leading zeroes), so we'd better ask the user to
> clarify.  But  '1' LIKE 1 is not ambiguous; there is only one
> plausible meaning for that, and we ought to adopt it, per the patch I
> proposed previously.  Rejecting SQL that other systems happily accept
> is unhelpful and unfriendly and it is costing us users and mind-share.

I don't agree with this opinion.  '1' + '2' might be claimed to have
only one plausible meaning as well, but that doesn't mean that we should
accept it.  There is a very fundamental distinction between numbers and
strings, and we'd do our users no service by pretending there isn't.
What's more, your argument for this essentially rests on the assumption
that LIKE represents only one possible operator choice, which is already
false today (see \do ~~) and might be even more false in future.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: SSL renegotiation
Next
From: Pavel Stehule
Date:
Subject: Re: checking variadic "any" argument in parser - should be array