Skip to content

Commit 6475701

Browse files
committed
pathman: documentation update
1 parent 6acf7e0 commit 6475701

File tree

2 files changed

+41
-12
lines changed

2 files changed

+41
-12
lines changed

contrib/pg_pathman/README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,32 @@ create_range_partitions(
6363
start_value ANYELEMENT,
6464
interval ANYELEMENT,
6565
premake INTEGER)
66-
```
67-
Performs RANGE partitioning for `relation` by partitioning key `attribute`. `start_value` argument specifies initial value, `interval` sets the range of values in a single partition, `premake` is the number of premade partitions (the only one partition will be created if `premake` is 0).
68-
```
66+
6967
create_range_partitions(
7068
relation TEXT,
7169
attribute TEXT,
7270
start_value ANYELEMENT,
7371
interval INTERVAL,
7472
premake INTEGER)
7573
```
76-
Same as above but suitable for `DATE` and `TIMESTAMP` partitioning keys.
74+
Performs RANGE partitioning for `relation` by partitioning key `attribute`. `start_value` argument specifies initial value, `interval` sets the range of values in a single partition, `premake` is the number of premade partitions.
75+
76+
```
77+
create_partitions_from_range(
78+
relation TEXT,
79+
attribute TEXT,
80+
start_value ANYELEMENT,
81+
end_value ANYELEMENT,
82+
interval ANYELEMENT)
83+
84+
create_partitions_from_range(
85+
relation TEXT,
86+
attribute TEXT,
87+
start_value ANYELEMENT,
88+
end_value ANYELEMENT,
89+
interval INTERVAL)
90+
```
91+
Performs RANGE-partitioning from specified range for `relation` by partitioning key `attribute`.
7792

7893
### Utilities
7994
```
@@ -159,9 +174,9 @@ INSERT INTO range_rel (dt) SELECT g FROM generate_series('2010-01-01'::date, '20
159174
```
160175
Run create_range_partitions() function to create partitions so that each partition would contain data for one month:
161176
```
162-
SELECT create_range_partitions('range_rel', 'dt', '2010-01-01'::date, '1 month'::interval, 59);
177+
SELECT create_range_partitions('range_rel', 'dt', '2010-01-01'::date, '1 month'::interval, 60);
163178
```
164-
It will create 60 partitions (one partition is created regardless of `premake` parameter). Now move data from the parent to partitions.
179+
It will create 60 partitions. Now let's move data from the parent to partitions.
165180
```
166181
SELECT partition_data('range_rel');
167182
```

contrib/pg_pathman/README.rus.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,32 @@ create_range_partitions(
6565
start_value ANYELEMENT,
6666
interval ANYELEMENT,
6767
premake INTEGER)
68-
```
69-
Выполняет RANGE-секционирование таблицы `relation` по полю `attribute`. Аргумент `start_value` задает начальное значение, `interval` -- диапазон значений внутри одной секции, `premake` -- количество заранее создаваемых секций (если 0, то будет создана единственная секция).
70-
```
68+
7169
create_range_partitions(
7270
relation TEXT,
7371
attribute TEXT,
7472
start_value ANYELEMENT,
7573
interval INTERVAL,
7674
premake INTEGER)
7775
```
78-
Аналогично предыдущей с тем лишь отличием, что данная функция предназначена для секционирования по полю типа `DATE` или `TIMESTAMP`.
76+
Выполняет RANGE-секционирование таблицы `relation` по полю `attribute`. Аргумент `start_value` задает начальное значение, `interval` -- диапазон значений внутри одной секции, `premake` -- количество заранее создаваемых секций.
77+
78+
```
79+
create_partitions_from_range(
80+
relation TEXT,
81+
attribute TEXT,
82+
start_value ANYELEMENT,
83+
end_value ANYELEMENT,
84+
interval ANYELEMENT)
85+
86+
create_partitions_from_range(
87+
relation TEXT,
88+
attribute TEXT,
89+
start_value ANYELEMENT,
90+
end_value ANYELEMENT,
91+
interval INTERVAL)
92+
```
93+
Выполняет RANGE-секционирование для заданного диапазона таблицы `relation` по полю `attribute`.
7994

8095
### Утилиты
8196
```
@@ -162,9 +177,8 @@ INSERT INTO range_rel (dt) SELECT g FROM generate_series('2010-01-01'::date, '20
162177
```
163178
Разобьем таблицу на 60 секций так, чтобы каждая секция содержала данные за один месяц:
164179
```
165-
SELECT create_range_partitions('range_rel', 'dt', '2010-01-01'::date, '1 month'::interval, 59);
180+
SELECT create_range_partitions('range_rel', 'dt', '2010-01-01'::date, '1 month'::interval, 60);
166181
```
167-
> Значение `premake` равно 59, а не 60, т.к. 1 секция создается независимо от значения `premake`
168182

169183
Перенесем данные из родительской таблицы в дочерние секции.
170184
```

0 commit comments

Comments
 (0)