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

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Dann Corbit <DCorbit(at)connx(dot)com>
Cc: Terry Fielder <terry(at)ashtonwoodshomes(dot)com>, Tino Wildenhain <tino(at)wildenhain(dot)de>, "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, Richard_D_Levine(at)raytheon(dot)com, pgsql-hackers(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [HACKERS] 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle
Date: 2005-10-19 21:33:33
Message-ID: 20051019142747.V2733@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Wed, 19 Oct 2005, Dann Corbit wrote:

> > -----Original Message-----
> > From: Terry Fielder [mailto:terry(at)ashtonwoodshomes(dot)com]
> > Sent: Wednesday, October 19, 2005 2:05 PM
> > To: Dann Corbit
> > Cc: Tino Wildenhain; Marc G. Fournier; Richard_D_Levine(at)raytheon(dot)com;
> > pgsql-hackers(at)postgresql(dot)org; pgsql-general(at)postgresql(dot)org
> > Subject: Re: 'a' == 'a ' (Was: RE: [pgsql-advocacy] [GENERAL] Oracle
> > buysInnobase)
> >
> >
> >
> > Dann Corbit wrote:
> > > Try this query in Oracle, SQL*Server, DB/2, Informix, etc.:
> > >
> > > connxdatasync=# select 1 where cast('a' as varchar(30)) = cast('a '
> as
> > > varchar(30));
> > > ?column?
> > > ----------
> > > (0 rows)
> > >
> > > I see how you can interpret the SQL Standard to make the above
> response
> > > a correct one. But is it the response that you would like?
> >
> > When the compared datatypes are VARCHAR: YES
>
> What is the value of doing that?
>
> 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?

It buys you the ability to store things where trailing spaces are
signficant (for example passwords) within the existing limitations of not
having a full set of the collation behavior.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dann Corbit 2005-10-19 21:38:26 Re: [HACKERS] 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle buysInnobase)
Previous Message Dann Corbit 2005-10-19 21:33:23 Re: [pgsql-advocacy] Oracle buys Innobase

Browse pgsql-hackers by date

  From Date Subject
Next Message Dann Corbit 2005-10-19 21:38:26 Re: [HACKERS] 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle buysInnobase)
Previous Message Dann Corbit 2005-10-19 21:05:20 Re: 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle buysInnobase)