On Thu, 03 Apr 2003 13:35:24 -0500, Jason Hihn
<jhihn@paytimepayroll.com> wrote:
>As someone pointed out, CHAR(1) costs 5 bytes.
Jason, you already found out, that char(1) uses
>4 bytes(stored string length) + 1 data in the case of char(1).
All char(n) types are stored on 4 byte boundaries, so char(1) costs up
to 8 bytes.
>But in returning to my question, what should I be using for char(1) to
>char(4) storage?
Instead of char(1) you can use the Postgres specific type "char"
(*with* the quotes) which only needs one byte.
For char(n) a little toy has been posted to -hackers half a year ago
(cf. discussion around
http://archives.postgresql.org/pgsql-hackers/2002-10/msg00501.php).
Feel free to play around with it. Though I wouldn't take the trouble
if only a few thousand rows are involved...
Servus
Manfred