Re: string cast/compare broken?

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas SB SD
Тема Re: string cast/compare broken?
Дата
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4961E1E@m0114.s-mxs.net
обсуждение исходный текст
Ответ на string cast/compare broken?  (Scott Royston <scroyston@mac.com>)
Ответы Re: string cast/compare broken?  ("John Liu" <johnl@synthesys.com>)
Re: string cast/compare broken?  (Andrew Sullivan <andrew@libertyrms.info>)
Список pgsql-hackers
> Has anyone studied how other DBMSs handle CHAR vs VARCHAR?  Judging
> from the number of questions we get on this point, I have to wonder
> if we are not out of step with the way other systems do it.

Well, I already gave the Informix example, that compares them as equal.
(they obviously coerce varchar to char)

In nearly all cases I have seen so far the different handling of trailing
blanks is not wanted. In most of these varchar is simply used instead of char to
save disk space.

In Informix ESQL/C there is a host variable type CSTRINGTYPE that automatically
rtrims columns of char type upon select.

Imho the advantages of an automatic coercion would outweigh the few corner cases
where the behavior would not be intuitive to everybody.

Andreas


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: string cast/compare broken?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: string cast/compare broken?