Re: 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle buys

From: Greg Stark <gsstark(at)mit(dot)edu>
To: "Guy Rouillier" <guyr(at)masergy(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle buys
Date: 2005-10-19 20:49:43
Message-ID: 87mzl59qqg.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"Guy Rouillier" <guyr(at)masergy(dot)com> writes:

> Tino Wildenhain wrote:
> >
> > experiment=# SELECT 'a '::char = 'a '::char;
> > ?column?
> > ----------
> > t
> >
>
> This does't show anything useful, because the ::char casting simply
> takes the first char of any string:
>
> select 'abc'::char = 'axy'::char
>
> Also results in 'true'. Hopefully no one in this discussion would want
> those two strings to be equal.

A better experiment:

db=> select 'a '::char(3) = 'a '::char(3);
?column?
----------
t
(1 row)

--
greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dann Corbit 2005-10-19 20:57:26 Re: [pgsql-advocacy] Oracle buys Innobase
Previous Message Terry Fielder 2005-10-19 20:38:31 Re: [pgsql-advocacy] Oracle buys Innobase

Browse pgsql-hackers by date

  From Date Subject
Next Message Terry Fielder 2005-10-19 21:05:14 Re: 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle buysInnobase)
Previous Message Guy Rouillier 2005-10-19 20:32:13 Re: 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle buys