Re: [GENERAL] Shouldn't B'1' = 1::bit be true?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] Shouldn't B'1' = 1::bit be true?
Дата
Msg-id 8842.1078945560@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] Shouldn't B'1' = 1::bit be true?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [GENERAL] Shouldn't B'1' = 1::bit be true?  ("Thomas Swan" <tswan@idigx.com>)
Список pgsql-hackers
"Thomas Swan" <tswan@idigx.com> writes:
> To convert low bits ot high bits you pad 0 bits on the left.   To convert
> from high to low you strip bits off the left hand side.  This allows
> reasonable behavior.

Unfortunately, the SQL spec is perfectly clear that you pad or strip
zero bits on the *right* of the bit string.  We cannot change that.

It might have been better if we had defined int<->bit casts to treat
the first bit of the bit string as the LSB of the integer.  But we
didn't, and it's probably too big a change to consider.

            regards, tom lane

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

Предыдущее
От: Andreas Pflug
Дата:
Сообщение: Re: Timing of 'SELECT 1'
Следующее
От: Kurt Roeckx
Дата:
Сообщение: Re: Timing of 'SELECT 1'