Skip to content

Commit 3f283b9

Browse files
feodordinama
authored andcommitted
Add support of pgsql v13
1 parent 4f78fbc commit 3f283b9

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

src/ruminsert.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,14 +550,23 @@ rumHeapTupleBulkInsert(RumBuildState * buildstate, OffsetNumber attnum,
550550
}
551551

552552
static void
553-
rumBuildCallback(Relation index, HeapTuple htup, Datum *values,
553+
rumBuildCallback(Relation index,
554+
#if PG_VERSION_NUM < 130000
555+
HeapTuple htup,
556+
#else
557+
ItemPointer tid,
558+
#endif
559+
Datum *values,
554560
bool *isnull, bool tupleIsAlive, void *state)
555561
{
556562
RumBuildState *buildstate = (RumBuildState *) state;
557563
MemoryContext oldCtx;
558564
int i;
559565
Datum outerAddInfo = (Datum) 0;
560566
bool outerAddInfoIsNull = true;
567+
#if PG_VERSION_NUM < 130000
568+
ItemPointer tid = &htup->t_self;
569+
#endif
561570

562571
if (AttributeNumberIsValid(buildstate->rumstate.attrnAttachColumn))
563572
{
@@ -570,7 +579,7 @@ rumBuildCallback(Relation index, HeapTuple htup, Datum *values,
570579
for (i = 0; i < buildstate->rumstate.origTupdesc->natts; i++)
571580
rumHeapTupleBulkInsert(buildstate, (OffsetNumber) (i + 1),
572581
values[i], isnull[i],
573-
&htup->t_self,
582+
tid,
574583
outerAddInfo, outerAddInfoIsNull);
575584

576585
/* If we've maxed out our available memory, dump everything to the index */

src/rumutil.c

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,25 @@ _PG_init(void)
8383

8484
add_string_reloption(rum_relopt_kind, "attach",
8585
"Column name to attach as additional info",
86-
NULL, NULL);
86+
NULL, NULL
87+
#if PG_VERSION_NUM >= 130000
88+
, AccessExclusiveLock
89+
#endif
90+
);
8791
add_string_reloption(rum_relopt_kind, "to",
8892
"Column name to add a order by column",
89-
NULL, NULL);
93+
NULL, NULL
94+
#if PG_VERSION_NUM >= 130000
95+
, AccessExclusiveLock
96+
#endif
97+
);
9098
add_bool_reloption(rum_relopt_kind, "order_by_attach",
9199
"Use (addinfo, itempointer) order instead of just itempointer",
92-
false);
100+
false
101+
#if PG_VERSION_NUM >= 130000
102+
, AccessExclusiveLock
103+
#endif
104+
);
93105
}
94106

95107
/*
@@ -875,14 +887,15 @@ rumExtractEntries(RumState * rumstate, OffsetNumber attnum,
875887
bytea *
876888
rumoptions(Datum reloptions, bool validate)
877889
{
878-
relopt_value *options;
879-
RumOptions *rdopts;
880-
int numoptions;
881890
static const relopt_parse_elt tab[] = {
882891
{"attach", RELOPT_TYPE_STRING, offsetof(RumOptions, attachColumn)},
883892
{"to", RELOPT_TYPE_STRING, offsetof(RumOptions, addToColumn)},
884893
{"order_by_attach", RELOPT_TYPE_BOOL, offsetof(RumOptions, useAlternativeOrder)}
885894
};
895+
#if PG_VERSION_NUM < 130000
896+
relopt_value *options;
897+
RumOptions *rdopts;
898+
int numoptions;
886899

887900
options = parseRelOptions(reloptions, validate, rum_relopt_kind,
888901
&numoptions);
@@ -899,6 +912,10 @@ rumoptions(Datum reloptions, bool validate)
899912
pfree(options);
900913

901914
return (bytea *) rdopts;
915+
#else
916+
return (bytea *) build_reloptions(reloptions, validate, rum_relopt_kind,
917+
sizeof(RumOptions), tab, lengthof(tab));
918+
#endif
902919
}
903920

904921
bool

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy