Re: casting BOOL to somthng

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: casting BOOL to somthng
Дата
Msg-id 20040901072051.N70341@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Re: casting BOOL to somthng  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
On Wed, 1 Sep 2004, Tom Lane wrote:

> Peter Eisentraut <peter_e@gmx.net> writes:
> > The cast to text, however, is part of the data model, and it has to be
> > both natural and universal.  I think you agree that there is no
> > universal, obvious correspondence between character strings and boolean
> > values, at least not nearly as universal and obvious as the well-known
> > correspondence between character strings and numbers.  We could pick
> > one arbitrary correspondence and implement it, and if we did we would
> > probably pick one that is consistent with the mapping used by libpq and
> > other frontends.  But doing that gains no functionality, so why bother?
>
> Actually it does gain functionality, because there are plenty of times
> when you need to manipulate a textual representation of a data value.

I don't think that doing so apart from trying to do output representation
is really a good idea in general (and for that I'd think something like
to_char would be more appropriate). For example, if people are casting
macaddrs to text in order to substring them or some such, that implies
to me that there are additional operations on macaddr we should have.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: casting BOOL to somthng
Следующее
От: Michael Kleiser
Дата:
Сообщение: Re: German "umlaut insensitive" query