smallint - word16
integer - word32
bigint - word64
decimal - TODO
numeric - TODO
real - float32
double precision - float64
char - word8
text, varchar - text[n]
bytea - bytes[n]
TODO
bool - word8(1 for True, 0 for False)
text[n]
json - text
jsonb - word8 - 1
text
word32 - dimension
word32 - 1 if array has NULL, 0 otherwise
oid - oid of element type
for each dimension:
word32 - elements in dimension
word32 - lower bound
for each element:
word32 - elements length
bytes[n] - encoded element
word32 - number of columns
for each column:
oid - oid of element
word32 - element length
bytes[n] - encoded element
word8 - flags(?)
if has lower bound:
word32 - length
bytes[n] - encoded lower bound as type
if has upper bound:
word32 - length
bytes[n] - encoded upper bound as type
oid