Re: Single character bitfields

Поиск
Список
Период
Сортировка
От Tomasz Ostrowski
Тема Re: Single character bitfields
Дата
Msg-id 48AD2B2A.3070205@batory.org.pl
обсуждение исходный текст
Ответ на Re: Single character bitfields  ("Andrew Maclean" <andrew.amaclean@gmail.com>)
Ответы Re: Single character bitfields  ("Andrew Maclean" <a.maclean@cas.edu.au>)
Re: Single character bitfields  (Decibel! <decibel@decibel.org>)
Список pgsql-general
On 2008-08-21 05:29, Andrew Maclean wrote:

> Is char(1) one byte in size?

No. It will also depend on database encoding, etc.

I think you should go with smallint, which is exactly 2 bytes. You'll
have 15 bits of storage (16 if you'd want to implement the special case
of minus sign).

IMHO the only smaller field are:
- one byte boolean, but it can only store 1 bit.
- one byte "char" (with quotes), but it is a non standard, integral
type, will cause interface problems and I don't know if it will not be
deprecated some time.

Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
                                                      Winnie the Pooh

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

Предыдущее
От: Tom Tom
Дата:
Сообщение: Re: pg_restore fails on Windows
Следующее
От: Shashwat_Nigam
Дата:
Сообщение: Re: [ADMIN] Regarding access to a user