@@ -699,8 +699,7 @@ pathman_shmem_startup_hook(void)
699699void
700700pathman_relcache_hook (Datum arg , Oid relid )
701701{
702- PartParentSearch search ;
703- Oid partitioned_table ;
702+ Oid parent_relid ;
704703
705704 /* Hooks can be disabled */
706705 if (!pathman_hooks_enabled )
@@ -721,50 +720,23 @@ pathman_relcache_hook(Datum arg, Oid relid)
721720 forget_bounds_of_partition (relid );
722721
723722 /* Invalidate PartParentInfo cache if needed */
724- partitioned_table = forget_parent_of_partition (relid , & search );
723+ parent_relid = forget_parent_of_partition (relid , NULL );
725724
726- switch (search )
725+ /* It *might have been a partition*, invalidate parent */
726+ if (OidIsValid (parent_relid ))
727727 {
728- /* It is (or was) a valid partition */
729- case PPS_ENTRY_PART_PARENT :
730- case PPS_ENTRY_PARENT :
731- {
732- elog (DEBUG2 , "Invalidation message for partition %u [%u]" ,
733- relid , MyProcPid );
734-
735- delay_invalidation_parent_rel (partitioned_table );
736- }
737- break ;
738-
739- /* Both syscache and pathman's cache say it isn't a partition */
740- case PPS_ENTRY_NOT_FOUND :
741- {
742- Assert (partitioned_table == InvalidOid );
743-
744- /* Which means that 'relid' might be parent */
745- if (relid != InvalidOid )
746- delay_invalidation_vague_rel (relid );
747- #ifdef NOT_USED
748- elog (DEBUG2 , "Invalidation message for relation %u [%u]" ,
749- relid , MyProcPid );
750- #endif
751- }
752- break ;
728+ delay_invalidation_parent_rel (parent_relid );
753729
754- /* We can't say anything (state is not transactional) */
755- case PPS_NOT_SURE :
756- {
757- elog (DEBUG2 , "Invalidation message for vague relation %u [%u]" ,
758- relid , MyProcPid );
759-
760- delay_invalidation_vague_rel (relid );
761- }
762- break ;
730+ elog (DEBUG2 , "Invalidation message for partition %u [%u]" ,
731+ relid , MyProcPid );
732+ }
733+ /* We can't say, perform full invalidation procedure */
734+ else
735+ {
736+ delay_invalidation_vague_rel (relid );
763737
764- default :
765- elog (ERROR , "Not implemented yet (%s)" ,
766- CppAsString (pathman_relcache_hook ));
767- break ;
738+ elog (DEBUG2 , "Invalidation message for vague relation %u [%u]" ,
739+ relid , MyProcPid );
768740 }
769741}
770742
0 commit comments