"Nigel J. Andrews" <nandrews@investsystems.co.uk> writes:
> ... I still can't see how use of CHECK makes the mapping from a textual type
> to integer.
It doesn't. The point people are making is that storing a (short) text
string is a perfectly respectable way to do this.
If you're feeling a compulsion to micro-optimize, though, I'd recommend
the trick I used to use: use datatype "char" (note the quotes). This is
*one* byte on disk, even smaller than integer, and you can still choose
characters with some mnemonic value for your different states. This
method works pretty well up to a dozen or two possible states, after
which it starts to get hard to choose values; but beyond that point
I'd think a separate table is the way to go anyway.
regards, tom lane