@@ -585,6 +585,7 @@ spawn_partitions_val(Oid parent_relid, /* parent's Oid */
585585 Oid parent_nsp = get_rel_namespace (parent_relid );
586586 char * parent_nsp_name = get_namespace_name (parent_nsp );
587587 char * partition_name = choose_range_partition_name (parent_relid , parent_nsp );
588+ char * pathman_schema ;
588589
589590 /* Assign the 'following' boundary to current 'leading' value */
590591 cur_following_bound = cur_leading_bound ;
@@ -611,10 +612,14 @@ spawn_partitions_val(Oid parent_relid, /* parent's Oid */
611612 typname = pstrdup (NameStr (((Form_pg_type ) GETSTRUCT (typeTuple ))-> typname ));
612613 ReleaseSysCache (typeTuple );
613614
615+ pathman_schema = get_namespace_name (get_pathman_schema ());
616+ if (pathman_schema == NULL )
617+ elog (ERROR , "pg_pathman schema not initialized" );
618+
614619 /* Construct call to create_single_range_partition() */
615620 create_sql = psprintf (
616621 "select %s.create_single_range_partition('%s.%s'::regclass, '%s'::%s, '%s'::%s, '%s.%s', NULL::text)" ,
617- quote_identifier (get_namespace_name ( get_pathman_schema ()) ),
622+ quote_identifier (pathman_schema ),
618623 quote_identifier (parent_nsp_name ),
619624 quote_identifier (get_rel_name (parent_relid )),
620625 IsInfinite (& bounds [0 ]) ? "NULL" : datum_to_cstring (bounds [0 ].value , range_bound_type ),
@@ -1195,6 +1200,8 @@ copy_foreign_keys(Oid parent_relid, Oid partition_oid)
11951200
11961201 /* Fetch pg_pathman's schema */
11971202 pathman_schema = get_namespace_name (get_pathman_schema ());
1203+ if (pathman_schema == NULL )
1204+ elog (ERROR , "pg_pathman schema not initialized" );
11981205
11991206 /* Build function's name */
12001207 copy_fkeys_proc_name = list_make2 (makeString (pathman_schema ),
@@ -1564,6 +1571,7 @@ build_raw_hash_check_tree(Node *raw_expression,
15641571
15651572 Oid hash_proc ;
15661573 TypeCacheEntry * tce ;
1574+ char * pathman_schema ;
15671575
15681576 tce = lookup_type_cache (value_type , TYPECACHE_HASH_PROC );
15691577 hash_proc = tce -> hash_proc ;
@@ -1596,9 +1604,13 @@ build_raw_hash_check_tree(Node *raw_expression,
15961604 hash_call -> over = NULL ;
15971605 hash_call -> location = -1 ;
15981606
1607+ pathman_schema = get_namespace_name (get_pathman_schema ());
1608+ if (pathman_schema == NULL )
1609+ elog (ERROR , "pg_pathman schema not initialized" );
1610+
15991611 /* Build schema-qualified name of function get_hash_part_idx() */
16001612 get_hash_part_idx_proc =
1601- list_make2 (makeString (get_namespace_name ( get_pathman_schema ()) ),
1613+ list_make2 (makeString (pathman_schema ),
16021614 makeString ("get_hash_part_idx" ));
16031615
16041616 /* Call get_hash_part_idx() */
0 commit comments