@@ -733,16 +733,6 @@ read_pathman_config(void)
733733 HeapScanDesc scan ;
734734 Snapshot snapshot ;
735735 HeapTuple htup ;
736- Oid * relids = NULL ;
737- Size relids_index = 0 ,
738- relids_count = 100 ,
739- j ;
740-
741- /*
742- * Initialize relids array, we keep here relations that require
743- * update their expression.
744- */
745- relids = (Oid * ) palloc (sizeof (Oid ) * relids_count );
746736
747737 /* Open PATHMAN_CONFIG with latest snapshot available */
748738 rel = heap_open (get_pathman_config_relid (false), AccessShareLock );
@@ -776,21 +766,9 @@ read_pathman_config(void)
776766 Assert (!isnull [Anum_pathman_config_expression_p - 1 ]);
777767 Assert (!isnull [Anum_pathman_config_upd_expression - 1 ]);
778768
779- upd_expr = DatumGetBool (values [Anum_pathman_config_upd_expression - 1 ]);
780- if (upd_expr )
781- {
782- if (relids_index >= relids_count )
783- {
784- relids_count += 100 ;
785- relids = (Oid * ) repalloc (relids , sizeof (Oid ) * relids_count );
786- }
787-
788- relids [relids_index ] = relid ;
789- relids_index += 1 ;
790- }
791-
792769 /* Extract values from Datums */
793770 relid = DatumGetObjectId (values [Anum_pathman_config_partrel - 1 ]);
771+ upd_expr = DatumGetBool (values [Anum_pathman_config_upd_expression - 1 ]);
794772
795773 /* Check that relation 'relid' exists */
796774 if (get_rel_type_id (relid ) == InvalidOid )
@@ -802,8 +780,9 @@ read_pathman_config(void)
802780 errhint (INIT_ERROR_HINT )));
803781 }
804782
805- /* get_pathman_relation_info() will refresh this entry */
806- if (!upd_expr )
783+ if (upd_expr )
784+ create_pathman_relation_info (relid );
785+ else
807786 refresh_pathman_relation_info (relid ,
808787 values ,
809788 true); /* allow lazy prel loading */
@@ -813,12 +792,6 @@ read_pathman_config(void)
813792 heap_endscan (scan );
814793 UnregisterSnapshot (snapshot );
815794 heap_close (rel , AccessShareLock );
816-
817- /* Update expressions */
818- for (j = 0 ; j < relids_index ; j ++ )
819- get_pathman_relation_info (relids [j ]);
820-
821- pfree (relids );
822795}
823796
824797
0 commit comments