Re: bit type external representation

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: bit type external representation
Дата
Msg-id GNELIHDDFBOCMGBFGEFOOECJCDAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответ на bit type external representation  (Thomas Lockhart <lockhart@fourpalms.org>)
Список pgsql-hackers
> for binary and hexadecimal representations. But at the moment we don't
> explicitly handle both of these cases as bit strings; the hex version is
> converted to decimal in the scanner (*really* early in the parsing
> stage) and then handled as an integer.
>
> It looks like our current bit string type support looks for a "B" or "X"
> embedded in the actual input string, rather than outside the quote as in
> the standard.

Postgres supports both:

test=# create table test (a bit(3));
CREATE
test=# insert into test values (B'101');
INSERT 3431020 1
test=# insert into test values (b'101');
INSERT 3431021 1
test=# insert into test values ('B101');
INSERT 3431022 1
test=# insert into test values ('b101');
INSERT 3431023 1
test=# select * from test; a
-----101101101101
(4 rows)

In fact, some of our apps actually _rely_ on the old 'b101' syntax...
Although these could be changed with some effort...

Chris



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

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: bit type external representation
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: bit type external representation