> Both text and varchar are stored in PostgreSQL as length + string so
> varchar(256) doesn't not require storage of the unused bytes. char space
> pads so it's the oddball (requiring length + padded string).
Yeah, I saw Vams's post and r3m3mb3r3d that I'd f0rg0t.
> varchar lengths should be in characters not bytes, so that should be 128
> characters in any of the encodings, but the actual number of bytes that
> those 128 characters can take up may vary.
And that's actually the best rationale, IMO, for making the optimization
a full-fledged feature. Boy, the things you forget ...
--
Joel Matthew <rees(at)ddcom(dot)co(dot)jp>