pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: bangh <banghe@baileylink.net>
To: Vladimir V. Zolotych <gsmith@eurocom.od.ua>
Cc: pgsql-admin@postgresql.org
Subject: Re: text & char(32)
Date: Tue, 19 Sep 2000 09:01:32 -0500
Message-ID: <39C771BB.438FC0C0@baileylink.net> (raw)
References: <Pine.LNX.4.21.0009200116290.1720-100000@hindang.msuiit.edu.ph>

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




view thread (4+ messages)  latest in thread

Message-ID: <39C771BB.438FC0C0@baileylink.net>
Permalink:  ../39C771BB.438FC0C0@baileylink.net/
Also on:    postgresql.org/message-id/39C771BB.438FC0C0@baileylink.net

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: banghe@baileylink.net, gsmith@eurocom.od.ua
  Subject: Re: text & char(32)
  In-Reply-To: <39C771BB.438FC0C0@baileylink.net>
  References: <Pine.LNX.4.21.0009200116290.1720-100000@hindang.msuiit.edu.ph> <39C771BB.438FC0C0@baileylink.net>

* 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