Tom Lane  committed 1e7d008

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

  • Participants
  • Parent commits ef19c9d
  • Branches rowexpr91

Comments (0)

Files changed (1)

File src/backend/access/gist/gist.c

 		elog(ERROR, "index \"%s\" already contains data",
+	/*
+	 * 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,
+				 errmsg("unlogged GiST indexes are not supported")));
 	/* no locking is needed */
 	initGISTstate(&buildstate.giststate, index);