Received: from mocha2.baileylink.net (mocha2.baileylink.net [63.71.213.28]) by hub.org (8.10.1/8.10.1) with SMTP id e8JDpts05292 for ; Tue, 19 Sep 2000 09:51:55 -0400 (EDT) Received: (qmail 16993 invoked from network); 19 Sep 2000 13:51:41 -0000 Received: from dhcp57.baileylink.net (HELO baileylink.net) (63.71.213.57) by mocha2.baileylink.net with SMTP; 19 Sep 2000 13:51:41 -0000 Message-ID: <39C771BB.438FC0C0@baileylink.net> Date: Tue, 19 Sep 2000 09:01:32 -0500 From: bangh X-Mailer: Mozilla 4.7 [en] (WinNT; U) X-Accept-Language: en,zh,zh-CN,zh-TW MIME-Version: 1.0 To: "Vladimir V. Zolotych" CC: pgsql-admin@postgresql.org Subject: Re: text & char(32) References: Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: 7bit X-Archive-Number: 200009/61 If your define your table using varchar(32), instead of char(32), your query will work fine. -- banghe Herbert Ambos wrote: > On Tue, 19 Sep 2000, Vladimir V. Zolotych wrote: > > > Hi all, > > Can you help me a bit ? > > The question is: how can I compare TEXT and CHAR(32) types ? > > More detailed description: > > my=> create table foo (tt text, cc char(32)); > > > > CREATE > > my=> insert into foo values ('aa', 'ab'); > > > > INSERT 27476810 1 > > my=> insert into foo values ('aa', 'aa'); > > > > INSERT 27476811 1 > > my=> select * from foo where tt=cc; > > > > tt|cc > > --+-- > > (0 rows) > > So the operator '=' doesn't work as I expected. > > Any help will be appreciated. > > > > > > try > > select * from foo where tt=trim(cc); > > herbert