Skip to content

Commit 621c4c4

Browse files
author
Pavel Safonov
committed
PostgreSQl: heap impl for version 13
1 parent c273a6c commit 621c4c4

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package postgres13
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;h
45+
/* total size (bytes): 4 */
46+
//
47+
/* total size (bytes): 12 */
48+
49+
func DecodeHeap(d *decode.D) any {
50+
heap := &common14.HeapD{
51+
PageSize: common.HeapPageSize,
52+
DecodePageHeaderDataFn: common14.DecodePageHeaderData,
53+
}
54+
return common14.DecodeHeap(d, heap)
55+
}

format/postgres/pgheap.go

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/wader/fq/format/postgres/flavours/pgproee14"
88
"github.com/wader/fq/format/postgres/flavours/postgres11"
99
"github.com/wader/fq/format/postgres/flavours/postgres12"
10+
"github.com/wader/fq/format/postgres/flavours/postgres13"
1011
"github.com/wader/fq/format/postgres/flavours/postgres14"
1112
"github.com/wader/fq/pkg/decode"
1213
"github.com/wader/fq/pkg/interp"
@@ -32,6 +33,8 @@ func decodePgheap(d *decode.D, in any) any {
3233
return postgres11.DecodeHeap(d)
3334
case PG_FLAVOUR_POSTGRES12:
3435
return postgres12.DecodeHeap(d)
36+
case PG_FLAVOUR_POSTGRES13:
37+
return postgres13.DecodeHeap(d)
3538
case PG_FLAVOUR_POSTGRES14, PG_FLAVOUR_POSTGRES:
3639
return postgres14.DecodeHeap(d)
3740
case PG_FLAVOUR_PGPROEE11:

0 commit comments

Comments
 (0)