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

From: Rick Morris <rick(at)brainscraps(dot)com>
To: Richard Huxton <dev(at)archonet(dot)com>, pgsql-hackers(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle buysInnobase)
Date: 2005-10-20 14:24:50
Message-ID: 4357A8B2.3050202@brainscraps.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Richard Huxton wrote:
> Dann Corbit wrote:
>
>>
>> I can see plenty of harm and absolutely no return. We are talking about
>> blank padding before comparison. Do you really want 'Danniel '
>> considered distinct from 'Danniel ' in a comparison? In real life,
>> what does that buy you?
>
>
> 100% YES!
>
> If two values are the same, then any function on those two values should
> return the same result. Otherwise what does "equals" mean? At the very
> least length() is broken by your argument.

I agree completely. I would much rather be precise than intuitive. And,
I have done applications where the padding length was important,
especially when working with remote batch processing in the credit
industries and the like. Writing queries to create and process
fixed-width batch files is much easier if you can rely on these kinds of
behaviors.

>
> Here it's CHAR that's broken IMHO - spawn of some punch-card spawned
> data processing rules of the 70s.
> --
> Richard Huxton
> Archonet Ltd
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sven Willenberger 2005-10-20 14:32:40 Re: NEW in Rule makes another nextval call?
Previous Message Tom Lane 2005-10-20 14:12:10 Re: server , client encoding issue

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-10-20 14:32:35 Re: 8.04 and RedHat/CentOS init script issue and sleep
Previous Message Tony Caduto 2005-10-20 14:18:13 Re: 8.04 and RedHat/CentOS init script issue and sleep