Ok, just a small issue here:
I'm running:
select attname,attlen,attalign from pg_attribute where attnum>0 and attrelid
= (select oid from pg_class where relname = 'users') order by attnum;
This is to get the name, length of that attribute and the alignment.
The alignment seems to be wrong for type CHAR(1):postalcode | -1 | igender | -1 | iyearofbirth |
2 | s
Gender is what I'm looking at and I think it's supposed to be 16 bit
aligned.
Here is the data from that area of the tuple:
0B00 0000 5435 5420 3257 3600 0500 0000 4600 5000
The postal code, 32 bit aligned extracts fine:
'T5T 2W6'
This one is a female, the size is listed as 0500 or 5 (header plus the 1
char in it) It extracts as an 'F', but you can see the year of birth 80
comes only 6 bytes after the gender. Perhaps my original query for the
alignments is wrong...
-Michael