Re: LIKE, CHAR(), and trailing spaces - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: LIKE, CHAR(), and trailing spaces
Date
Msg-id AANLkTikB9nbesPX7q-UDYNTQEU8qi3KGE=qzPMHRYRu+@mail.gmail.com
Whole thread Raw
In response to LIKE, CHAR(), and trailing spaces  (Bruce Momjian <bruce@momjian.us>)
Responses Re: LIKE, CHAR(), and trailing spaces  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On 3 February 2011 10:54, Bruce Momjian <bruce@momjian.us> wrote:
> It seems LIKE is considering the trailing CHAR(10) field spaces as
> significant, even though our documentations says:
>
-- snip --
>
> It says trailing spaces are not significant for character comparisons
> --- the real question is whether LIKE is a comparison.  Obvioiusly '='
> is a comparison, but the system does not treat LIKE as a comparison in
> terms of trailing spaces.  Is that desired behavior?

Interesting.  I would have to say that from the user point of view,
LIKE is definitely a comparison, and if the rest of the operators on
bpchar ignore whitespace then LIKE ought to as well.

Is the situation the same for regex matches (~ operators)?

Cheers,
BJ


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: LIKE, CHAR(), and trailing spaces
Next
From: Bruce Momjian
Date:
Subject: Re: LIKE, CHAR(), and trailing spaces