|
| 1 | +package pgpro13 |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/wader/fq/format/postgres/common" |
| 5 | + "github.com/wader/fq/format/postgres/flavours/postgres14/common14" |
| 6 | + "github.com/wader/fq/pkg/decode" |
| 7 | +) |
| 8 | + |
| 9 | +// type = struct PageHeaderData { |
| 10 | +/* 0 | 8 */ // PageXLogRecPtr pd_lsn; |
| 11 | +/* 8 | 2 */ // uint16 pd_checksum; |
| 12 | +/* 10 | 2 */ // uint16 pd_flags; |
| 13 | +/* 12 | 2 */ // LocationIndex pd_lower; |
| 14 | +/* 14 | 2 */ // LocationIndex pd_upper; |
| 15 | +/* 16 | 2 */ // LocationIndex pd_special; |
| 16 | +/* 18 | 2 */ // uint16 pd_pagesize_version |
| 17 | +/* 20 | 4 */ // TransactionId pd_prune_xid |
| 18 | +/* 24 | 0 */ // ItemIdData pd_linp[] |
| 19 | +// |
| 20 | +/* total size (bytes): 24 */ |
| 21 | + |
| 22 | +// type = struct HeapTupleHeaderData { |
| 23 | +/* 0 | 12 */ // union { |
| 24 | +/* 12 */ // HeapTupleFields t_heap; |
| 25 | +/* 12 */ // DatumTupleFields t_datum; |
| 26 | +// } t_choice; |
| 27 | +/* total size (bytes): 12 */ |
| 28 | + |
| 29 | +/* 12 | 6 */ // ItemPointerData t_ctid; |
| 30 | +/* 18 | 2 */ // uint16 t_infomask2; |
| 31 | +/* 20 | 2 */ // uint16 t_infomask; |
| 32 | +/* 22 | 1 */ // uint8 t_hoff; |
| 33 | +/* 23 | 0 */ // bits8 t_bits[]; |
| 34 | +/* XXX 1-byte padding */ |
| 35 | +// |
| 36 | +/* total size (bytes): 24 */ |
| 37 | + |
| 38 | +// type = struct HeapTupleFields { |
| 39 | +/* 0 | 4 */ // TransactionId t_xmin; |
| 40 | +/* 4 | 4 */ // TransactionId t_xmax; |
| 41 | +/* 8 | 4 */ // union { |
| 42 | +/* 4 */ // CommandId t_cid; |
| 43 | +/* 4 */ // TransactionId t_xvac; |
| 44 | +// } t_field3; |
| 45 | +/* total size (bytes): 4 */ |
| 46 | +// |
| 47 | +/* total size (bytes): 12 */ |
| 48 | + |
| 49 | +// type = struct DatumTupleFields { |
| 50 | +/* 0 | 4 */ // int32 datum_len_; |
| 51 | +/* 4 | 4 */ // int32 datum_typmod; |
| 52 | +/* 8 | 4 */ // Oid datum_typeid; |
| 53 | +// |
| 54 | +/* total size (bytes): 12 */ |
| 55 | + |
| 56 | +func DecodeHeap(d *decode.D) any { |
| 57 | + heap := &common14.HeapD{ |
| 58 | + PageSize: common.HeapPageSize, |
| 59 | + DecodePageHeaderDataFn: common14.DecodePageHeaderData, |
| 60 | + } |
| 61 | + return common14.DecodeHeap(d, heap) |
| 62 | +} |
0 commit comments