Skip to content
Snippets Groups Projects
Commit 331bf671 authored by Tom Lane's avatar Tom Lane
Browse files

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.
parent d77354ea
No related branches found
No related tags found
No related merge requests found
......@@ -144,6 +144,16 @@ gistbuild(PG_FUNCTION_ARGS)
elog(ERROR, "index \"%s\" already contains data",
RelationGetRelationName(index));
/*
* We can't yet handle unlogged GiST indexes, because we depend on LSNs.
* This is duplicative of an error in gistbuildempty, but we want to check
* here so as to throw error before doing all the index-build work.
*/
if (heap->rd_rel->relpersistence == RELPERSISTENCE_UNLOGGED)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("unlogged GiST indexes are not supported")));
/* no locking is needed */
buildstate.giststate = initGISTstate(index);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment