Single Byte values

From: Jason Hihn <jhihn(at)paytimepayroll(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Single Byte values
Date: 2003-04-03 18:35:24
Message-ID: NGBBLHANMLKMHPDGJGAPEEHKCGAA.jhihn@paytimepayroll.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

As someone pointed out, CHAR(1) costs 5 bytes. Is there a better way to
store it? I can see one or three bytes as being bad (byte-alignment issues
and speed) Two could be ok, but at the very least 4 should be the max for
char(1).

Two is ok, once you consider multi-bytes strings (unicode)
Three is right out -
Four bytes could store two multibyte, two single byte (cast as 2 byte for
unicode) or four single byte characters.

But in returning to my question, what should I be using for char(1) to
char(4) storage?

Thanks again!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-04-03 18:36:03 Re: problems installing postgre
Previous Message Ericson Smith 2003-04-03 18:34:55 Re: server config file, where is it