| From: | "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au> |
|---|---|
| To: | "Thomas Lockhart" <lockhart(at)fourpalms(dot)org>, "PostgreSQL Hackers List" <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: bit type external representation |
| Date: | 2002-07-16 03:12:21 |
| Message-ID: | GNELIHDDFBOCMGBFGEFOOECJCDAA.chriskl@familyhealth.com.au |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
-----
101
101
101
101
(4 rows)
In fact, some of our apps actually _rely_ on the old 'b101' syntax...
Although these could be changed with some effort...
Chris
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Thomas Lockhart | 2002-07-16 03:20:25 | Re: bit type external representation |
| Previous Message | Thomas Lockhart | 2002-07-16 03:08:53 | Re: bit type external representation |