@@ -725,6 +725,9 @@ add_to_pathman_config(PG_FUNCTION_ARGS)
725
725
else ereport (ERROR , (errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
726
726
errmsg ("'parent_relid' should not be NULL" )));
727
727
728
+ /* Lock relation */
729
+ xact_lock_rel_exclusive (relid , true);
730
+
728
731
/* Check that relation exists */
729
732
if (!SearchSysCacheExists1 (RELOID , ObjectIdGetDatum (relid )))
730
733
ereport (ERROR , (errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
@@ -792,11 +795,11 @@ add_to_pathman_config(PG_FUNCTION_ARGS)
792
795
/*
793
796
* Initialize columns (partrel, attname, parttype, range_interval).
794
797
*/
795
- values [Anum_pathman_config_partrel - 1 ] = ObjectIdGetDatum (relid );
796
- isnull [Anum_pathman_config_partrel - 1 ] = false;
798
+ values [Anum_pathman_config_partrel - 1 ] = ObjectIdGetDatum (relid );
799
+ isnull [Anum_pathman_config_partrel - 1 ] = false;
797
800
798
- values [Anum_pathman_config_parttype - 1 ] = Int32GetDatum (parttype );
799
- isnull [Anum_pathman_config_parttype - 1 ] = false;
801
+ values [Anum_pathman_config_parttype - 1 ] = Int32GetDatum (parttype );
802
+ isnull [Anum_pathman_config_parttype - 1 ] = false;
800
803
801
804
values [Anum_pathman_config_expr - 1 ] = CStringGetTextDatum (expression );
802
805
isnull [Anum_pathman_config_expr - 1 ] = false;
0 commit comments