The following bug has been logged online:
Bug reference: 3765
Logged by: Cade Cairns
Email address: cadec(at)otii(dot)com
PostgreSQL version: 8.1.10
Operating system: Mac OS X 10.5.1
Description: strange results for bit string hex notation cast to bit
Details:
When casting a bit string constant using hexadecimal notation to a longer
bit string, the result is padded with 0's on the right. This will result in
inconsistent/useless results:
test=# select x'ff'::integer;
int4
------
255
(1 row)
test=# select x'ff'::bit(16)::integer;
int4
-------
65280
(1 row)