Content-Length: 271117 | pFad | http://github.com/postgrespro/postgres/commit/331bf6712c71a1c110bc52423eede8b4bac221a1

C3 Throw error sooner for unlogged GiST indexes. · postgrespro/postgres@331bf67 · GitHub
Skip to content

Commit 331bf67

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 d77354e commit 331bf67

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/backend/access/gist/gistbuild.c

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

147+
/*
148+
* We can't yet handle unlogged GiST indexes, because we depend on LSNs.
149+
* This is duplicative of an error in gistbuildempty, but we want to check
150+
* here so as to throw error before doing all the index-build work.
151+
*/
152+
if (heap->rd_rel->relpersistence == RELPERSISTENCE_UNLOGGED)
153+
ereport(ERROR,
154+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
155+
errmsg("unlogged GiST indexes are not supported")));
156+
147157
/* no locking is needed */
148158
buildstate.giststate = initGISTstate(index);
149159

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/331bf6712c71a1c110bc52423eede8b4bac221a1

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy