Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1e7d008

Browse files
committed
Throw error sooner for unlogged GiST indexes.
Throwing an error only after we've built the main index fork is pretty unfriendly when the table already contains data. Per gripe from Jay Levitt.
1 parent ef19c9d commit 1e7d008

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/backend/access/gist/gist.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ gistbuild(PG_FUNCTION_ARGS)
113113
elog(ERROR, "index \"%s\" already contains data",
114114
RelationGetRelationName(index));
115115

116+
/*
117+
* We can't yet handle unlogged GiST indexes, because we depend on LSNs.
118+
* This is duplicative of an error in gistbuildempty, but we want to check
119+
* here so as to throw error before doing all the index-build work.
120+
*/
121+
if (heap->rd_rel->relpersistence == RELPERSISTENCE_UNLOGGED)
122+
ereport(ERROR,
123+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
124+
errmsg("unlogged GiST indexes are not supported")));
125+
116126
/* no locking is needed */
117127
initGISTstate(&buildstate.giststate, index);
118128

0 commit comments

Comments
 (0)