[SQL] = or LIKE ?

2009-02-15 Thread Jesper Krogh
Hi. Can anyone explain me this behavior? testdb=# select E'\\' = E'\\'; ?column? -- t (1 row) testdb=# select E'\\' like E'\\'; ?column? -- f (1 row) Shouldnt the like operator do the same as the = if there occours no wildcards and stuff in the string? -- Jesper --

Re: [SQL] = or LIKE ?

2009-02-15 Thread Tom Lane
Jesper Krogh jes...@krogh.cc writes: Shouldnt the like operator do the same as the = if there occours no wildcards and stuff in the string? If there are also no escape characters, then yeah. FWIW, 8.4 will complain about this case: regression=# select E'\\' like E'\\'; ERROR: LIKE pattern

Re: [SQL] = or LIKE ?

2009-02-15 Thread Jesper Krogh
Tom Lane wrote: Jesper Krogh jes...@krogh.cc writes: Shouldnt the like operator do the same as the = if there occours no wildcards and stuff in the string? If there are also no escape characters, then yeah. FWIW, 8.4 will complain about this case: regression=# select E'\\' like E'\\';