Re: string cast/compare broken?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Scott Royston <scroyston(at)mac(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: string cast/compare broken?
Date: 2002-07-12 03:50:25
Message-ID: 6698.1026445825@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Scott Royston <scroyston(at)mac(dot)com> writes:
> [ various examples of comparing char and varchar ]

I see no bug here. For the CHAR datatype, trailing spaces are defined
to be insignificant. For VARCHAR and TEXT, trailing spaces are
significant. If you want to compare a CHAR value to a VARCHAR or TEXT
value, your best bet is a locution like
rtrim(charval) = varcharval

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2002-07-12 04:14:07 Re: string cast/compare broken?
Previous Message Bruce Momjian 2002-07-12 03:43:20 Re: [PATCHES] Changes in /contrib/fulltextindex