Tom Lane writes:
> Is there a way out of this? I'm not sure. I don't think that the SQL
> spec's bitstring definitions are really intended to allow sensible
> mappings to integer values --- so maybe there is no way to satisfy the
> spec and have natural integer mappings at the same time.
They are "bit strings" after all, not binary numbers. If you need a
binary number, use any numeric type and format the input and output
accordingly.
As for converting between bit strings and numbers, maybe we should make
pairs of explicit functions that assume one bit order or another, and
remove the casts.
All things considered, it was probably a good idea that they removed bit
strings in SQL200x.
--
Peter Eisentraut peter_e@gmx.net