Skip to content

Commit b2af9ac

Browse files
committed
pathman: minor fixes
1 parent bb6883d commit b2af9ac

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

contrib/pg_pathman/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ attach_range_partition(
138138
start_value ANYELEMENT,
139139
end_value ANYELEMENT)
140140
```
141-
Attaches partition to existing RANGE partitioned relation.
141+
Attaches partition to existing RANGE partitioned relation. The table being attached must have exact same structure as the parent one.
142142

143143
```
144144
detach_range_partition(partition TEXT)

contrib/pg_pathman/README.rus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ attach_range_partition(
140140
start_value ANYELEMENT,
141141
end_value ANYELEMENT)
142142
```
143-
Присоединяет существующую таблицу `partition` в качестве секции к ранее секционированной таблице `relation`.
143+
Присоединяет существующую таблицу `partition` в качестве секции к ранее секционированной таблице `relation`. Структура присоединяемой таблицы должна в точности повторять структуру родительской.
144144

145145
```
146146
detach_range_partition(partition TEXT)

contrib/pg_pathman/pl_funcs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,17 @@ find_or_create_range_partition(PG_FUNCTION_ARGS)
9999
TYPECACHE_CMP_PROC | TYPECACHE_CMP_PROC_FINFO);
100100

101101
prel = get_pathman_relation_info(relid, NULL);
102+
rangerel = get_pathman_range_relation(relid, NULL);
103+
104+
if (!prel || !rangerel || rangerel->ranges.length == 0)
105+
PG_RETURN_NULL();
106+
102107
cmp_proc_oid = get_opfamily_proc(tce->btree_opf,
103108
value_type,
104109
prel->atttype,
105110
BTORDER_PROC);
106111
fmgr_info(cmp_proc_oid, &cmp_func);
107112

108-
rangerel = get_pathman_range_relation(relid, NULL);
109-
110-
if (!rangerel || rangerel->ranges.length == 0)
111-
PG_RETURN_NULL();
112-
113113
ranges = dsm_array_get_pointer(&rangerel->ranges);
114114
pos = range_binary_search(rangerel, &cmp_func, value, &found);
115115

0 commit comments

Comments
 (0)