From: Josh Berkus <josh@agliodbs.com>
To: Tomas Eriksson <tomas_@spray.se>
To: pgsql-sql@postgresql.org
Subject: Re: Compare with CHAR
Date: Fri, 01 Feb 2002 11:41:47 -0800
Message-ID: <web-682319@davinci.ethosmedia.com> (raw)
In-Reply-To: <a3e3f1$1m7k$1@news.tht.net>
Tomas,
> I'm using a table with a indexed CHAR(3)-column. When I use SELECT ..
> WHERE
> Col = 'XXX', some results are empty, but the value in the row seems
> to be
> correct like other rows. If I update the row with same data I can get
> it
> into the result. So I didn't find any logic reason for this. I can
> find all
> rows using LIKE (or with some substring tests) with no problems.
> Shouldn't =
> always works the same..? (Postgres 7.1.3)
I'm pretty sure that your problem has something to do with the
space-padding of CHAR columns. Please remember that
'JB'::CHAR(5) = 'JB ' != 'JB'::VARCHAR(5)
If you're sure that's not it, how about posting a tabledef and some
queries?
-Josh
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com, tomas_@spray.se
Subject: Re: Compare with CHAR
In-Reply-To: <web-682319@davinci.ethosmedia.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox