Philip Warner <pjw@rhyme.com.au> writes:
> See my earlier post in this thread questioning which was the low order bit.
That seems to be the crux of the matter. Given the assumption that
padding or truncation occurs on the right of the bitstring, ISTM that
you will only get sensible behavior for integer<->bitstring mappings
if the integer's LSB maps to the leftmost bit of the bitstring.
Yet it would seem a tad odd to make 8 map to B'0001'. I sure don't
find that natural.
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.
regards, tom lane