pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedCompare with CHAR
2+ messages / 2 participants
[nested] [flat]
* Compare with CHAR
@ 2002-02-01 12:59 Tomas Eriksson <tomas_@spray.se>
2002-02-01 19:41 ` Re: Compare with CHAR Josh Berkus <josh@agliodbs.com>
0 siblings, 1 reply; 2+ messages in thread
From: Tomas Eriksson @ 2002-02-01 12:59 UTC (permalink / raw)
To: pgsql-sql
Hi.
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)
kind regards
Tomas
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Compare with CHAR
2002-02-01 12:59 Compare with CHAR Tomas Eriksson <tomas_@spray.se>
@ 2002-02-01 19:41 ` Josh Berkus <josh@agliodbs.com>
0 siblings, 0 replies; 2+ messages in thread
From: Josh Berkus @ 2002-02-01 19:41 UTC (permalink / raw)
To: Tomas Eriksson <tomas_@spray.se>; pgsql-sql
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2002-02-01 19:41 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-02-01 12:59 Compare with CHAR Tomas Eriksson <tomas_@spray.se>
2002-02-01 19:41 ` Josh Berkus <josh@agliodbs.com>
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