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

Поиск
Список
Период
Сортировка
От Dann Corbit
Тема Re: 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle buysInnobase)
Дата
Msg-id D425483C2C5C9F49B5B7A41F8944154757D20A@postal.corporate.connx.com
обсуждение исходный текст
Ответы Re: [HACKERS] 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle buysInnobase)  (Martijn van Oosterhout <kleptog@svana.org>)
Re: 'a' == 'a ' (Was: RE: [pgsql-advocacy] Oracle buysInnobase)  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
> -----Original Message-----
> From: Terry Fielder [mailto:terry@ashtonwoodshomes.com]
> Sent: Wednesday, October 19, 2005 2:05 PM
> To: Dann Corbit
> Cc: Tino Wildenhain; Marc G. Fournier; Richard_D_Levine@raytheon.com;
> pgsql-hackers@postgresql.org; pgsql-general@postgresql.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?

And even if people think it is a good idea, it seems to be at odds with
the way that I read the standard (though I am easily confused by simple
enough language at times).

It could well be that I am jaded from years of doing it the wrong way (I
expect two character strings with all leading non-blanks in agreement to
compare equal).

Perhaps this is old hat to the long-timers around here and there is a
good explanation as to why varchar should have non-blank padding when
comparisons are performed.  Can someone point me to documentation that
explains it?

[snip]

В списке pgsql-general по дате отправления:

Предыдущее
От: "Marius Cornea"
Дата:
Сообщение: Re: Create GLOBAL TABLE
Следующее
От: "Guy Rouillier"
Дата:
Сообщение: Re: [pgsql-advocacy] Oracle buys Innobase