Re: [GENERAL] Boolean storage takes up 1 byte?

2009-10-02 Thread Tom Lane
Simon Riggs writes: > It might be possible to make BOOLEAN NOT NULL use the null bit to > represent the actual data value and then have the column use no > additional bytes, except when we don't store the null bitmap at all. > Just needs people to make it happen cleanly, if that's possible. I rea

Re: [GENERAL] Boolean storage takes up 1 byte?

2009-10-02 Thread Simon Riggs
On Thu, 2009-10-01 at 12:03 +0100, Sam Mason wrote: > > However, I see that a boolean takes up 1 > > byte of storage, which is 8 bits. Is this due to the fact that the value > > can be null? > > I believe it's more to do with the fact that if you add a boolean column > and then subsequently an

Re: [GENERAL] Boolean storage takes up 1 byte?

2009-10-01 Thread Thom Brown
2009/10/1 Sam Mason > > bool_or and bool_and are aggregates that work over boolean data types. > > Ah yes, that makes total sense! I knew max wouldn't be logical in such as case, but couldn't think of the alternative. Thanks! > > I believe it's more to do with the fact that if you add a boole

Re: [GENERAL] Boolean storage takes up 1 byte?

2009-10-01 Thread Sam Mason
On Thu, Oct 01, 2009 at 11:37:40AM +0100, Thom Brown wrote: > I've read the PostgreSQL documentation page on the boolean datatype ( > http://www.postgresql.org/docs/8.4/static/datatype-boolean.html) to find out > what PostgreSQL's definition of a boolean is, as I believe it is distinctive > from a

[GENERAL] Boolean storage takes up 1 byte?

2009-10-01 Thread Thom Brown
Hi, I've read the PostgreSQL documentation page on the boolean datatype ( http://www.postgresql.org/docs/8.4/static/datatype-boolean.html) to find out what PostgreSQL's definition of a boolean is, as I believe it is distinctive from a bit(1) datatype (as you can't max() a boolean.. not sure what a