Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f283b9

Browse files
feodordinama
authored andcommitted
Add support of pgsql v13
1 parent4f78fbc commit3f283b9

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
staticvoid
553-
rumBuildCallback(Relationindex,HeapTuplehtup,Datum*values,
553+
rumBuildCallback(Relationindex,
554+
#ifPG_VERSION_NUM<130000
555+
HeapTuplehtup,
556+
#else
557+
ItemPointertid,
558+
#endif
559+
Datum*values,
554560
bool*isnull,booltupleIsAlive,void*state)
555561
{
556562
RumBuildState*buildstate= (RumBuildState*)state;
557563
MemoryContextoldCtx;
558564
inti;
559565
DatumouterAddInfo= (Datum)0;
560566
boolouterAddInfoIsNull= true;
567+
#ifPG_VERSION_NUM<130000
568+
ItemPointertid=&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+
#ifPG_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+
#ifPG_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+
#ifPG_VERSION_NUM >=130000
102+
,AccessExclusiveLock
103+
#endif
104+
);
93105
}
94106

95107
/*
@@ -875,14 +887,15 @@ rumExtractEntries(RumState * rumstate, OffsetNumber attnum,
875887
bytea*
876888
rumoptions(Datumreloptions,boolvalidate)
877889
{
878-
relopt_value*options;
879-
RumOptions*rdopts;
880-
intnumoptions;
881890
staticconstrelopt_parse_elttab[]= {
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+
#ifPG_VERSION_NUM<130000
896+
relopt_value*options;
897+
RumOptions*rdopts;
898+
intnumoptions;
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)

[8]ページ先頭

©2009-2025 Movatter.jp