Skip to content

Commit 7bf6b11

Browse files
author
Pavel Safonov
committed
add pgpro13 heap
1 parent 2b3035f commit 7bf6b11

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
}

format/postgres/pgheap.go

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package postgres
22

33
import (
44
"github.com/wader/fq/format"
5+
"github.com/wader/fq/format/postgres/flavours/pgpro13"
56
"github.com/wader/fq/format/postgres/flavours/pgpro14"
67
"github.com/wader/fq/format/postgres/flavours/pgproee10"
78
"github.com/wader/fq/format/postgres/flavours/pgproee11"
@@ -48,6 +49,8 @@ func decodePgheap(d *decode.D, in any) any {
4849
return pgproee12.DecodeHeap(d)
4950
case PG_FLAVOUR_PGPROEE13:
5051
return pgproee13.DecodeHeap(d)
52+
case PG_FLAVOUR_PGPRO13:
53+
return pgpro13.DecodeHeap(d)
5154
case PG_FLAVOUR_PGPRO14:
5255
return pgpro14.DecodeHeap(d)
5356
case PG_FLAVOUR_PGPROEE14:

0 commit comments

Comments
 (0)