Re: [HACKERS] LIKE, CHAR(), and trailing spaces

2011-02-03 Thread Kenneth Marshall
On Wed, Feb 02, 2011 at 07:48:38PM -0500, Bruce Momjian wrote: Brendan Jurd wrote: On 3 February 2011 10:54, Bruce Momjian br...@momjian.us wrote: It seems LIKE is considering the trailing CHAR(10) field spaces as significant, even though our documentations says: -- snip -- It

Re: [HACKERS] LIKE, CHAR(), and trailing spaces

2011-02-03 Thread Tom Lane
Kenneth Marshall k...@rice.edu writes: On Wed, Feb 02, 2011 at 07:48:38PM -0500, Bruce Momjian wrote: It seems LIKE is considering the trailing CHAR(10) field spaces as significant, even though our documentations says: +10 for leaving the behavior as is. Yeah, we've been around on this

[HACKERS] LIKE, CHAR(), and trailing spaces

2011-02-02 Thread Bruce Momjian
I found a little LIKE/CHAR() surprise --- below is a table and query against a CHAR(10) field: test= CREATE TABLE test (x char(10)); CREATE TABLE test= INSERT INTO test values ('hi'); INSERT 0 1 test= SELECT * FROM test WHERE x = 'hi'; x

Re: [HACKERS] LIKE, CHAR(), and trailing spaces

2011-02-02 Thread Brendan Jurd
On 3 February 2011 10:54, Bruce Momjian br...@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

Re: [HACKERS] LIKE, CHAR(), and trailing spaces

2011-02-02 Thread Bruce Momjian
Brendan Jurd wrote: On 3 February 2011 10:54, Bruce Momjian br...@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