* RegisterRelcacheInvalidation * * As above, but register a relcache invalidation event. */
| 542 | * As above, but register a relcache invalidation event. |
| 543 | */ |
| 544 | static void |
| 545 | RegisterRelcacheInvalidation(Oid dbId, Oid relId) |
| 546 | { |
| 547 | AddRelcacheInvalidationMessage(&transInvalInfo->CurrentCmdInvalidMsgs, |
| 548 | dbId, relId); |
| 549 | |
| 550 | /* |
| 551 | * Most of the time, relcache invalidation is associated with system |
| 552 | * catalog updates, but there are a few cases where it isn't. Quick hack |
| 553 | * to ensure that the next CommandCounterIncrement() will think that we |
| 554 | * need to do CommandEndInvalidationMessages(). |
| 555 | */ |
| 556 | (void) GetCurrentCommandId(true); |
| 557 | |
| 558 | /* |
| 559 | * If the relation being invalidated is one of those cached in a relcache |
| 560 | * init file, mark that we need to zap that file at commit. For simplicity |
| 561 | * invalidations for a specific database always invalidate the shared file |
| 562 | * as well. Also zap when we are invalidating whole relcache. |
| 563 | */ |
| 564 | if (relId == InvalidOid || RelationIdIsInInitFile(relId)) |
| 565 | transInvalInfo->RelcacheInitFileInval = true; |
| 566 | } |
| 567 | |
| 568 | #ifdef USE_ASSERT_CHECKING |
| 569 | static char * |
no test coverage detected