Skip to content

Commit f3bcfc7

Browse files
committed
pathman: concurrency problem in insert trigger solved
1 parent 74106fe commit f3bcfc7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/pg_pathman/pl_funcs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ find_or_create_range_partition(PG_FUNCTION_ARGS)
101101
prel = get_pathman_relation_info(relid, NULL);
102102
rangerel = get_pathman_range_relation(relid, NULL);
103103

104-
if (!prel || !rangerel || rangerel->ranges.length == 0)
104+
if (!prel || !rangerel)
105105
PG_RETURN_NULL();
106106

107107
cmp_proc_oid = get_opfamily_proc(tce->btree_opf,
@@ -135,6 +135,7 @@ find_or_create_range_partition(PG_FUNCTION_ARGS)
135135
pos = range_binary_search(rangerel, &cmp_func, value, &found);
136136
if (found)
137137
{
138+
LWLockRelease(edit_partitions_lock);
138139
LWLockRelease(load_config_lock);
139140
PG_RETURN_OID(ranges[pos].child_oid);
140141
}

0 commit comments

Comments
 (0)