Re: Single character bitfields

Поиск
Список
Период
Сортировка
От Bill Moran
Тема Re: Single character bitfields
Дата
Msg-id 20080821083601.5848b928.wmoran@collaborativefusion.com
обсуждение исходный текст
Ответ на Single character bitfields  ("Andrew Maclean" <andrew.amaclean@gmail.com>)
Ответы Re: Single character bitfields  ("Andrew Maclean" <a.maclean@cas.edu.au>)
Список pgsql-general
In response to "Andrew Maclean" <andrew.amaclean@gmail.com>:

> I have a large database and I want to have several fields (among many)
> that are single character fields (in fact they are bitfields).
>
> 1) Is char(1) the most efficient way to store these fields? If not
> what is better?
> 2) I need to test the field against constants, e.g if the field is
> called source then I need tests like:
>     IF source = 0x10 THEN ...
>    This does not work in plpgsql functions (source is character(1)),
> so what is the solution?

I'm not sure I understand what you're trying to accomplish, but there's
a bit string type:
http://www.postgresql.org/docs/8.3/static/datatype-bit.html

--
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

wmoran@collaborativefusion.com
Phone: 412-422-3463x4023

В списке pgsql-general по дате отправления:

Предыдущее
От: "Merlin Moncure"
Дата:
Сообщение: Re: function SETOF return type with variable columns?
Следующее
От: "Amber"
Дата:
Сообщение: Re: What's size of your PostgreSQL Database?