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

Commit7212340

Browse files
committed
change rum versioning
1 parent183b747 commit7212340

File tree

3 files changed

+9
-31
lines changed

3 files changed

+9
-31
lines changed

‎rum.h

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ typedef RumPageOpaqueData *RumPageOpaque;
5959

6060
typedefstructRumMetaPageData
6161
{
62+
/*
63+
* RUM version number
64+
*/
65+
uint32rumVersion;
66+
6267
/*
6368
* Pointers to head and tail of pending list, which consists of RUM_LIST
6469
* pages. These store fast-inserted entries that haven't yet been moved
@@ -86,21 +91,9 @@ typedef struct RumMetaPageData
8691
BlockNumbernEntryPages;
8792
BlockNumbernDataPages;
8893
int64nEntries;
89-
90-
/*
91-
* RUM version number (ideally this should have been at the front, but too
92-
* late now. Don't move it!)
93-
*
94-
* Currently 1 (for indexes initialized in 9.1 or later)
95-
*
96-
* Version 0 (indexes initialized in 9.0 or before) is compatible but may
97-
* be missing null entries, including both null keys and placeholders.
98-
* Reject full-index-scan attempts on such indexes.
99-
*/
100-
int32rumVersion;
10194
}RumMetaPageData;
10295

103-
#defineRUM_CURRENT_VERSION1
96+
#defineRUM_CURRENT_VERSION(0xC0DE0001)
10497

10598
#defineRumPageGetMeta(p) \
10699
((RumMetaPageData *) PageGetContents(p))

‎rumscan.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -436,24 +436,6 @@ rumNewScanKey(IndexScanDesc scan)
436436
NULL,NULL,NULL,NULL, false);
437437
}
438438

439-
/*
440-
* If the index is version 0, it may be missing null and placeholder
441-
* entries, which would render searches for nulls and full-index scans
442-
* unreliable. Throw an error if so.
443-
*/
444-
if (hasNullQuery&& !so->isVoidRes)
445-
{
446-
GinStatsDatarumStats;
447-
448-
rumGetStats(scan->indexRelation,&rumStats);
449-
if (rumStats.ginVersion<1)
450-
ereport(ERROR,
451-
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
452-
errmsg("old RUM indexes do not support whole-index scans nor searches for nulls"),
453-
errhint("To fix this, do REINDEX INDEX \"%s\".",
454-
RelationGetRelationName(scan->indexRelation))));
455-
}
456-
457439
pgstat_count_index_scan(scan->indexRelation);
458440
}
459441

‎rumutil.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,9 @@ rumGetStats(Relation index, GinStatsData *stats)
811811
stats->nEntries=metadata->nEntries;
812812
stats->ginVersion=metadata->rumVersion;
813813

814+
if (stats->ginVersion!=RUM_CURRENT_VERSION)
815+
elog(ERROR,"unexpected RUM index version. Reindex");
816+
814817
UnlockReleaseBuffer(metabuffer);
815818
}
816819

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp