diff --git a/src/ruminsert.c b/src/ruminsert.c index e34a247..2d9a6aa 100644 --- a/src/ruminsert.c +++ b/src/ruminsert.c @@ -550,7 +550,7 @@ rumHeapTupleBulkInsert(RumBuildState * buildstate, OffsetNumber attnum, } static void -rumBuildCallback(Relation index, HeapTuple htup, Datum *values, +rumBuildCallback(Relation index, ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, void *state) { RumBuildState *buildstate = (RumBuildState *) state; @@ -570,7 +570,7 @@ rumBuildCallback(Relation index, HeapTuple htup, Datum *values, for (i = 0; i < buildstate->rumstate.origTupdesc->natts; i++) rumHeapTupleBulkInsert(buildstate, (OffsetNumber) (i + 1), values[i], isnull[i], - &htup->t_self, + tid, outerAddInfo, outerAddInfoIsNull); /* If we've maxed out our available memory, dump everything to the index */ diff --git a/src/rumutil.c b/src/rumutil.c index 2b2af13..f997f27 100644 --- a/src/rumutil.c +++ b/src/rumutil.c @@ -83,13 +83,25 @@ _PG_init(void) add_string_reloption(rum_relopt_kind, "attach", "Column name to attach as additional info", - NULL, NULL); + NULL, NULL +#if PG_VERSION_NUM >= 130000 + ,AccessExclusiveLock +#endif + ); add_string_reloption(rum_relopt_kind, "to", "Column name to add a order by column", - NULL, NULL); + NULL, NULL +#if PG_VERSION_NUM >= 130000 + ,AccessExclusiveLock +#endif + ); add_bool_reloption(rum_relopt_kind, "order_by_attach", "Use (addinfo, itempointer) order instead of just itempointer", - false); + false +#if PG_VERSION_NUM >= 130000 + ,AccessExclusiveLock +#endif + ); } /* @@ -875,30 +887,16 @@ rumExtractEntries(RumState * rumstate, OffsetNumber attnum, bytea * rumoptions(Datum reloptions, bool validate) { - relopt_value *options; - RumOptions *rdopts; - int numoptions; static const relopt_parse_elt tab[] = { {"attach", RELOPT_TYPE_STRING, offsetof(RumOptions, attachColumn)}, {"to", RELOPT_TYPE_STRING, offsetof(RumOptions, addToColumn)}, {"order_by_attach", RELOPT_TYPE_BOOL, offsetof(RumOptions, useAlternativeOrder)} }; - options = parseRelOptions(reloptions, validate, rum_relopt_kind, - &numoptions); - - /* if none set, we're done */ - if (numoptions == 0) - return NULL; - - rdopts = allocateReloptStruct(sizeof(RumOptions), options, numoptions); - - fillRelOptions((void *) rdopts, sizeof(RumOptions), options, numoptions, - validate, tab, lengthof(tab)); - - pfree(options); - - return (bytea *) rdopts; + return (bytea *) build_reloptions(reloptions, validate, + rum_relopt_kind, + sizeof(RumOptions), + tab, lengthof(tab)); } bool