diff options
author | Alexander Korotkov | 2024-04-06 21:57:22 +0000 |
---|---|---|
committer | Alexander Korotkov | 2024-04-06 22:18:43 +0000 |
commit | 1adf16b8fba45f77056d91573cd7138ed9da4ebf (patch) | |
tree | ee8cddd9d9883aab432ddcb3e328bda0e851c953 /src/include/partitioning/partbounds.h | |
parent | fe1431e39cdde5f65cb52f068bc86a7490f8a4e3 (diff) |
Implement ALTER TABLE ... MERGE PARTITIONS ... command
This new DDL command merges several partitions into the one partition of the
target table. The target partition is created using new
createPartitionTable() function with parent partition as the template.
This commit comprises quite naive implementation which works in single process
and holds the ACCESS EXCLUSIVE LOCK on the parent table during all the
operations including the tuple routing. This is why this new DDL command
can't be recommended for large partitioned tables under a high load. However,
this implementation come in handy in certain cases even as is.
Also, it could be used as a foundation for future implementations with lesser
locking and possibly parallel.
Discussion: https://postgr.es/m/c73a1746-0cd0-6bdd-6b23-3ae0b7c0c582%40postgrespro.ru
Author: Dmitry Koval
Reviewed-by: Matthias van de Meent, Laurenz Albe, Zhihong Yu, Justin Pryzby
Reviewed-by: Alvaro Herrera, Robert Haas, Stephane Tachoires
Diffstat (limited to 'src/include/partitioning/partbounds.h')
-rw-r--r-- | src/include/partitioning/partbounds.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/partitioning/partbounds.h b/src/include/partitioning/partbounds.h index 3d9cc1031f7..0329d7bd848 100644 --- a/src/include/partitioning/partbounds.h +++ b/src/include/partitioning/partbounds.h @@ -143,4 +143,10 @@ extern int partition_range_datum_bsearch(FmgrInfo *partsupfunc, extern int partition_hash_bsearch(PartitionBoundInfo boundinfo, int modulus, int remainder); +extern void calculate_partition_bound_for_merge(Relation parent, + List *partNames, + List *partOids, + PartitionBoundSpec *spec, + ParseState *pstate); + #endif /* PARTBOUNDS_H */ |