postgresql/src/test/modules/test_ddl_deparse
Alexander Korotkov 87c21bb941 Implement ALTER TABLE ... SPLIT PARTITION ... command
This new DDL command splits a single partition into several parititions.
Just like ALTER TABLE ... MERGE PARTITIONS ... command, new patitions are
created using 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
2024-04-07 01:18:44 +03:00
..
expected Support identity columns in partitioned tables 2024-01-16 17:24:52 +01:00
sql Remove logic for converting a table to a view. 2022-12-02 12:14:32 -05:00
.gitignore Make modules/test_ddl_deparse/.gitignore match its siblings. 2015-08-03 00:02:26 -04:00
Makefile Use TSConfigRelationId in AlterTSConfiguration() 2016-12-22 17:08:43 -05:00
README Fix various common mispellings. 2016-06-03 16:08:45 +01:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_ddl_deparse--1.0.sql Expand tests of test_ddl_deparse/ for ALTER TABLE 2022-07-31 11:48:14 +09:00
test_ddl_deparse.c Implement ALTER TABLE ... SPLIT PARTITION ... command 2024-04-07 01:18:44 +03:00
test_ddl_deparse.control Allow on-the-fly capture of DDL event details 2015-05-11 19:14:31 -03:00

README

test_ddl_deparse is an example of how to use the pg_ddl_command datatype.
It is not intended to do anything useful on its own; rather, it is a
demonstration of how to use the datatype, and to provide some unit tests for
it.

The functions in this extension are intended to be able to process some
part of the struct and produce some readable output, preferably handling
all possible cases so that SQL test code can be written.