Skip to content

Commit 288bf73

Browse files
committed
documentation fixes and description for replace_hash_partition() function
1 parent 1709c15 commit 288bf73

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ Done! Now it's time to setup your partitioning schemes.
8484
create_hash_partitions(relation REGCLASS,
8585
attribute TEXT,
8686
partitions_count INTEGER,
87-
partition_name TEXT DEFAULT NULL,
8887
partition_data BOOLEAN DEFAULT TRUE)
8988
```
90-
Performs HASH partitioning for `relation` by integer key `attribute`. The `partitions_count` parameter specifies the number of partitions to create; it cannot be changed afterwards. If `partition_data` is `true` then all the data will be automatically copied from the parent table to partitions. Note that data migration may took a while to finish and the table will be locked until transaction commits. See `partition_table_concurrently()` for a lock-free way to migrate data. Partition creation callback is invoked for each partition if set beforehand (see `set_part_init_callback()`).
89+
Performs HASH partitioning for `relation` by integer key `attribute`. The `partitions_count` parameter specifies the number of partitions to create; it cannot be changed afterwards. If `partition_data` is `true` then all the data will be automatically copied from the parent table to partitions. Note that data migration may took a while to finish and the table will be locked until transaction commits. See `partition_table_concurrently()` for a lock-free way to migrate data. Partition creation callback is invoked for each partition if set beforehand (see `set_init_callback()`).
9190

9291
```plpgsql
9392
create_range_partitions(relation REGCLASS,
@@ -148,6 +147,14 @@ create_range_update_trigger(parent REGCLASS)
148147
Same as above, but for a RANGE-partitioned table.
149148

150149
### Post-creation partition management
150+
```plpgsql
151+
replace_hash_partition(old_partition REGCLASS,
152+
new_partition REGCLASS,
153+
lock_parent BOOL DEFAULT TRUE)
154+
```
155+
Replaces specified partition of HASH-partitioned table with another table. The `lock_parent` parameter will prevent any INSERT/UPDATE/ALTER TABLE queries to parent table.
156+
157+
151158
```plpgsql
152159
split_range_partition(partition REGCLASS,
153160
split_value ANYELEMENT,

0 commit comments

Comments
 (0)