Re: Efficient Boolean Storage - Mailing list pgsql-general

From Joe Conway
Subject Re: Efficient Boolean Storage
Date
Msg-id 3DEE3DDD.8070508@joeconway.com
Whole thread Raw
In response to Re: Efficient Boolean Storage  (Csaba Nagy <nagy@domeus.de>)
List pgsql-general
Csaba Nagy wrote:
> BTW, is or is not using Postgres a string to store the bit data types ? I
> have seen a few people asking this on the list, but no straight answer as of
> yet... the docs really don't mention this aspect.

Use the source ;-)

 From varbit.c

  /*----------
   *      attypmod -- contains the length of the bit string in bits, or for
   *                         varying bits the maximum length.
   *
   *      The data structure contains the following elements:
   *        header  -- length of the whole data structure (incl header)
   *                   in bytes. (as with all varying length datatypes)
   *        data section -- private data section for the bits data structures
   *              bitlength -- length of the bit string in bits
   *              bitdata   -- bit string, most significant byte first
   *
   *      The length of the bitdata vector should always be exactly as many
   *      bytes as are needed for the given bitlength.  If the bitlength is
   *      not a multiple of 8, the extra low-order padding bits of the last
   *      byte must be zeroes.
   *----------
   */

Joe


pgsql-general by date:

Previous
From: Matthew Gabeler-Lee
Date:
Subject: Re: 7.3 no longer using indexes for LIKE queries
Next
From: Bruce Momjian
Date:
Subject: Re: Anyone working on OLAP stuff?