Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g11Jfnl86964 for ; Fri, 1 Feb 2002 14:41:49 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.2) with HTTP id 682319; Fri, 01 Feb 2002 11:41:47 -0800 From: "Josh Berkus" Subject: Re: Compare with CHAR To: "Tomas Eriksson" , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.5.2 Date: Fri, 01 Feb 2002 11:41:47 -0800 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200202/20 X-Sequence-Number: 6452 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