mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-03 03:00:56 +08:00
Removed code for Postgres < 10
This commit is contained in:
@@ -205,11 +205,7 @@ GetNextTuple(Tuplesortstate *sortstate, TupleDesc tupdesc, TupleTableSlot *slot,
|
||||
Datum value;
|
||||
bool isnull;
|
||||
|
||||
#if PG_VERSION_NUM >= 100000
|
||||
if (tuplesort_gettupleslot(sortstate, true, false, slot, NULL))
|
||||
#else
|
||||
if (tuplesort_gettupleslot(sortstate, true, slot, NULL))
|
||||
#endif
|
||||
{
|
||||
*list = DatumGetInt32(slot_getattr(slot, 1, &isnull));
|
||||
value = slot_getattr(slot, 3, &isnull);
|
||||
|
||||
@@ -66,9 +66,7 @@ static void
|
||||
ivfflatcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
|
||||
Cost *indexStartupCost, Cost *indexTotalCost,
|
||||
Selectivity *indexSelectivity, double *indexCorrelation
|
||||
#if PG_VERSION_NUM >= 100000
|
||||
,double *indexPages
|
||||
#endif
|
||||
)
|
||||
{
|
||||
GenericCosts costs;
|
||||
@@ -86,9 +84,7 @@ ivfflatcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
|
||||
*indexTotalCost = DBL_MAX;
|
||||
*indexSelectivity = 0;
|
||||
*indexCorrelation = 0;
|
||||
#if PG_VERSION_NUM >= 100000
|
||||
*indexPages = 0;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -116,9 +112,7 @@ ivfflatcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
|
||||
*indexTotalCost = costs.indexTotalCost;
|
||||
*indexSelectivity = costs.indexSelectivity;
|
||||
*indexCorrelation = costs.indexCorrelation;
|
||||
#if PG_VERSION_NUM >= 100000
|
||||
*indexPages = costs.numIndexPages;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -186,9 +180,7 @@ ivfflathandler(PG_FUNCTION_ARGS)
|
||||
amroutine->amstorage = false;
|
||||
amroutine->amclusterable = false;
|
||||
amroutine->ampredlocks = false;
|
||||
#if PG_VERSION_NUM >= 100000
|
||||
amroutine->amcanparallel = false;
|
||||
#endif
|
||||
#if PG_VERSION_NUM >= 110000
|
||||
amroutine->amcaninclude = false;
|
||||
#endif
|
||||
@@ -224,11 +216,9 @@ ivfflathandler(PG_FUNCTION_ARGS)
|
||||
amroutine->amrestrpos = NULL;
|
||||
|
||||
/* Interface functions to support parallel index scans */
|
||||
#if PG_VERSION_NUM >= 100000
|
||||
amroutine->amestimateparallelscan = NULL;
|
||||
amroutine->aminitparallelscan = NULL;
|
||||
amroutine->amparallelrescan = NULL;
|
||||
#endif
|
||||
|
||||
PG_RETURN_POINTER(amroutine);
|
||||
}
|
||||
|
||||
@@ -234,9 +234,7 @@ bool ivfflatinsert(Relation index, Datum *values, bool *isnull, ItemPointer hea
|
||||
#if PG_VERSION_NUM >= 140000
|
||||
,bool indexUnchanged
|
||||
#endif
|
||||
#if PG_VERSION_NUM >= 100000
|
||||
,IndexInfo *indexInfo
|
||||
#endif
|
||||
);
|
||||
IndexBulkDeleteResult *ivfflatbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state);
|
||||
IndexBulkDeleteResult *ivfflatvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats);
|
||||
|
||||
@@ -156,9 +156,7 @@ ivfflatinsert(Relation index, Datum *values, bool *isnull, ItemPointer heap_tid,
|
||||
#if PG_VERSION_NUM >= 140000
|
||||
,bool indexUnchanged
|
||||
#endif
|
||||
#if PG_VERSION_NUM >= 100000
|
||||
,IndexInfo *indexInfo
|
||||
#endif
|
||||
)
|
||||
{
|
||||
IndexTuple itup;
|
||||
|
||||
@@ -302,11 +302,7 @@ ivfflatgettuple(IndexScanDesc scan, ScanDirection dir)
|
||||
pfree(DatumGetPointer(value));
|
||||
}
|
||||
|
||||
#if PG_VERSION_NUM >= 100000
|
||||
if (tuplesort_gettupleslot(so->sortstate, true, false, so->slot, NULL))
|
||||
#else
|
||||
if (tuplesort_gettupleslot(so->sortstate, true, so->slot, NULL))
|
||||
#endif
|
||||
{
|
||||
ItemPointer tid = (ItemPointer) DatumGetPointer(slot_getattr(so->slot, 2, &so->isnull));
|
||||
BlockNumber indexblkno = DatumGetInt32(slot_getattr(so->slot, 3, &so->isnull));
|
||||
|
||||
@@ -20,15 +20,8 @@ sub test_index_replay
|
||||
# Wait for replica to catch up
|
||||
my $applname = $node_replica->name;
|
||||
|
||||
my $caughtup_query;
|
||||
my $server_version_num = $node_primary->safe_psql("postgres", "SHOW server_version_num");
|
||||
if ($server_version_num >= 100000) {
|
||||
$caughtup_query = "SELECT pg_current_wal_lsn() <= replay_lsn FROM pg_stat_replication WHERE application_name = '$applname';";
|
||||
} else {
|
||||
# TODO figure out why replay location doesn't work
|
||||
$caughtup_query = "SELECT pg_current_xlog_location() <= write_location FROM pg_stat_replication WHERE application_name = '$applname';";
|
||||
}
|
||||
|
||||
my $caughtup_query = "SELECT pg_current_wal_lsn() <= replay_lsn FROM pg_stat_replication WHERE application_name = '$applname';";
|
||||
$node_primary->poll_query_until('postgres', $caughtup_query)
|
||||
or die "Timed out while waiting for replica 1 to catch up";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user