Re: bit strings - anyone working on them? - Mailing list pgsql-hackers

From Philip Warner
Subject Re: bit strings - anyone working on them?
Date
Msg-id 5.1.0.14.0.20030424004359.058a7c18@mail.rhyme.com.au
Whole thread Raw
In response to Re: bit strings - anyone working on them?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: bit strings - anyone working on them?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
At 10:36 AM 23/04/2003 -0400, Tom Lane wrote:

> > Cast(8 as bit(10)) => '0001000000'
> > Cast(8 as bit(4)) => '0001'
>
>That part we could do, I think, if you are willing to abandon the
>assumption that the result of casting int to bit(n) and then to bit(m)
>should agree with the result of casting int directly to bit(m).

I'm not sure I follow the implication; in fact I would hope that:
    Cast(B'0001' as bit(10))

would yield '0001000000'.



> > B'1' # Cast(1 as bit(32)) => '00000000000000000000000000000000'
>
>Eh?  What is the # operator supposed to be doing here?

It's the XOR operator.  Current implementation has:
    Cast(B'1' as bit(32)) XOR Cast(1 as bit(32))
giving    10000000000000000000000000000001

Another thing I have forgotten to mention is that there are no 
text<->varbit conversions.


>Perhaps these
>operators should only exist for varbit, or should demand inputs already
>the same length for bit.

That seems like a good idea. I'd prefer to make these changes for varbit only.





----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 03 5330 3172          |                 ___________ |
Http://www.rhyme.com.au          |                /           \|                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: bit strings - anyone working on them?
Next
From: Tom Lane
Date:
Subject: Re: bit strings - anyone working on them?