Re: text & char(32)

From: Herbert Ambos <herbert(at)hindang(dot)msuiit(dot)edu(dot)ph>
To: "Vladimir V(dot) Zolotych" <gsmith(at)eurocom(dot)od(dot)ua>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: text & char(32)
Date: 2000-09-19 17:17:37
Message-ID: Pine.LNX.4.21.0009200116290.1720-100000@hindang.msuiit.edu.ph
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Gavin M. Roy 2000-09-20 04:33:12 Re: NOTICE: CREATE TABLE/FOREIGN KEY clause ignored; not yet implemented
Previous Message bangh 2000-09-19 14:01:32 Re: text & char(32)