LIKE, "=" and fixed-width character fields

From: "Dmitry Teslenko" <dteslenko(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: LIKE, "=" and fixed-width character fields
Date: 2008-11-10 14:22:29
Message-ID: 91325fec0811100622wba49e85n86df222565df4584@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello!
There's table:
CREATE TABLE table1 (
field1 CHARACTER(10),
...
);

Then there's record: INSERT INTO table1(field1, ..) VALUES ('111', ...);

Then I query it:
SELECT * FROM table1 WHERE field1 <operator> '111';

When <operator> is LIKE no records matches query, when <operator> is =
my record matches query. Why? And Does this behavior varies from
PostgreSQL 7.4 to 8.1?

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Lavoie 2008-11-10 14:37:16 Re: Importing text file into a TEXT field
Previous Message Adriana Alfonzo 2008-11-10 14:00:31 Re: Importing text file into a TEXT field