Skip to content

Instantly share code, notes, and snippets.

@vadv
Created April 1, 2016 06:26
Show Gist options
  • Save vadv/8bc2838f50cf441a7f6314a3f4d8364a to your computer and use it in GitHub Desktop.
Save vadv/8bc2838f50cf441a7f6314a3f4d8364a to your computer and use it in GitHub Desktop.
diff --git a/src/backend/commands/indexcmds.c
b/src/backend/commands/indexcmds.c
index 13b04e6..1024603 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -881,6 +881,12 @@ DefineIndex(Oid relationId,
CacheInvalidateRelcacheByRelid(heaprelid.relId);
/*
+ * Force WAL commit record to ensure that replica receives invalidation
+ * messages.
+ */
+ GetCurrentTransactionId();
+
+ /*
* Last thing to do is release the session-level lock on the
parent table.
*/
UnlockRelationIdForSession(&heaprelid, ShareUpdateExclusiveLock);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment