"Jim C. Nasby" <jim(at)nasby(dot)net> writes:
> On Mon, Apr 07, 2003 at 11:51:17PM -0400, Tom Lane wrote:
>> or just declare project_id to be integer (hint: the space savings are
>> completely illusory in this example, anyway, because of alignment
>> requirements).
> Hrm... where can I find more info about that?
The authoritative reference is pg_type.typalign ... see
http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/catalog-pg-type.html
In this example, your next field requires integer alignment, so the
two bytes "saved" by using smallint disappear into the padding.
regards, tom lane