Bit Varying vs New Column

From: Barry Laffoon <gotobarry(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Bit Varying vs New Column
Date: 2011-07-04 19:26:48
Message-ID: CAFOa+WFkeqw3y6Cdk_UdGSrWxwKGDo_YJ2mXBK9fNgCNndxmaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi There,

I have a property on a web form that is multi-select so the property can
have multiple values. Normally I'd create separate column or a separate row
for each value. I am thinking of using the BIT VARYING() data type though
and storing the selected values as a bit mask. So I have several related
questions:

1. Any general comments on how this performs?
2. Does someone have an example of a query where clause with the values in
the BIT VARYING column being compared to a bit mask?
3. Does someone have a JDBC example. I've tried String, BYTE[], Blob, byte[]
as the Java type and none seem to work.

Thanks
Barry

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jean-Yves F. Barbier 2011-07-04 19:41:25 Re: Bit Varying vs New Column
Previous Message Greg Sabino Mullane 2011-07-04 18:05:35 Re: Postgresql Wiki page