postgresql/src/test/modules
Alexander Korotkov 4b3d173629 Implement ALTER TABLE ... SPLIT PARTITION ... command
This new DDL command splits a single partition into several partitions.  Just
like the ALTER TABLE ... MERGE PARTITIONS ... command, new partitions are
created using the createPartitionTable() function with the parent partition
as the template.

This commit comprises a quite naive implementation which works in a single
process and holds the ACCESS EXCLUSIVE LOCK on the parent table during all
the operations, including the tuple routing.  This is why the new DDL command
can't be recommended for large, partitioned tables under high load.  However,
this implementation comes in handy in certain cases, even as it is.  Also, it
could serve as a foundation for future implementations with less locking and
possibly parallelism.

Discussion: https://postgr.es/m/c73a1746-0cd0-6bdd-6b23-3ae0b7c0c582%40postgrespro.ru
Author: Dmitry Koval <d.koval@postgrespro.ru>
Co-authored-by: Alexander Korotkov <aekorotkov@gmail.com>
Co-authored-by: Tender Wang <tndrwang@gmail.com>
Co-authored-by: Richard Guo <guofenglinux@gmail.com>
Co-authored-by: Dagfinn Ilmari Mannsaker <ilmari@ilmari.org>
Co-authored-by: Fujii Masao <masao.fujii@gmail.com>
Co-authored-by: Jian He <jian.universality@gmail.com>
Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com>
Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at>
Reviewed-by: Zhihong Yu <zyu@yugabyte.com>
Reviewed-by: Justin Pryzby <pryzby@telsasoft.com>
Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Robert Haas <rhaas@postgresql.org>
Reviewed-by: Stephane Tachoires <stephane.tachoires@gmail.com>
Reviewed-by: Jian He <jian.universality@gmail.com>
Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>
Reviewed-by: Pavel Borisov <pashkin.elfe@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Alexander Lakhin <exclusion@gmail.com>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Daniel Gustafsson <dgustafsson@postgresql.org>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Noah Misch <noah@leadboat.com>
2025-12-14 13:29:38 +02:00
..
brin BRIN autosummarization may need a snapshot 2025-11-04 13:23:26 +01:00
commit_ts Disable commit timestamps during bootstrap 2025-07-04 15:09:24 +09:00
delay_execution Add ExplainState argument to pg_plan_query() and planner(). 2025-10-08 08:33:29 -04:00
dummy_index_am Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
dummy_seclabel Update copyright for 2025 2025-01-01 11:21:55 -05:00
gin Fix failures with cross-version pg_upgrade tests 2025-12-10 12:46:45 +09:00
index Move isolation test index-killtuples to src/test/modules/index/ 2025-11-24 19:33:51 +09:00
injection_points injection_points: Remove portions related to custom pgstats 2025-12-08 12:45:20 +09:00
ldap_password_func Replace deprecated log_connections values in docs and tests 2025-05-22 17:14:54 -04:00
libpq_pipeline Provide more-specific error details/hints for function lookup failures. 2025-09-16 12:17:02 -04:00
nbtree Fix failures with cross-version pg_upgrade tests 2025-12-10 12:46:45 +09:00
oauth_validator oauth_validator: Shorten JSON responses in test logs 2025-11-25 20:39:47 -08:00
plsample Update copyright for 2025 2025-01-01 11:21:55 -05:00
spgist_name_ops Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
ssl_passphrase_callback Apply more consistent style for command options in TAP tests 2025-03-17 12:42:23 +09:00
test_aio bufmgr: Allow some buffer state modifications while holding header lock 2025-11-06 16:42:10 -05:00
test_binaryheap Add a test harness for the binary heap code. 2025-07-17 16:32:10 -05:00
test_bitmapset Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
test_bloomfilter Get rid of our dependency on type "long" for memory size calculations. 2025-01-31 13:52:40 -05:00
test_cloexec Fix O_CLOEXEC flag handling in Windows port. 2025-12-10 09:01:35 +13:00
test_copy_callbacks Use PRI?64 instead of "ll?" in format strings (continued). 2025-03-29 10:43:57 +01:00
test_custom_rmgrs Remove unnecessary (char *) casts [xlog] 2025-02-13 10:57:07 +01:00
test_custom_stats test_custom_stats: Test module for custom cumulative statistics 2025-12-08 15:23:09 +09:00
test_ddl_deparse Implement ALTER TABLE ... SPLIT PARTITION ... command 2025-12-14 13:29:38 +02:00
test_dsa test_dsa: Avoid leaking LWLock tranches. 2025-11-12 14:57:48 -06:00
test_dsm_registry Show size of DSAs and dshashes in pg_dsm_registry_allocations. 2025-12-02 10:29:45 -06:00
test_escape With GB18030, prevent SIGSEGV from reading past end of allocation. 2025-05-05 04:52:04 -07:00
test_extensions Provide more-specific error details/hints for function lookup failures. 2025-09-16 12:17:02 -04:00
test_ginpostinglist Update copyright for 2025 2025-01-01 11:21:55 -05:00
test_int128 Guard against division by zero in test_int128 module. 2025-10-25 11:08:46 +01:00
test_integerset Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
test_json_parser Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
test_lfind Update copyright for 2025 2025-01-01 11:21:55 -05:00
test_lwlock_tranches Add a test harness for the LWLock tranche code. 2025-09-18 15:23:11 -05:00
test_misc Check for tabs in postgresql.conf.sample. 2025-11-18 10:28:36 -06:00
test_oat_hooks Update copyright for 2025 2025-01-01 11:21:55 -05:00
test_parser Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
test_pg_dump Improve TAP tests by replacing ok() with better Test::More functions 2025-10-17 14:39:09 +09:00
test_predtest Update copyright for 2025 2025-01-01 11:21:55 -05:00
test_radixtree Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
test_rbtree Update copyright for 2025 2025-01-01 11:21:55 -05:00
test_regex Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
test_resowner Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
test_rls_hooks Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
test_shm_mq Use correct DatumGet*() function in test_shm_mq_main(). 2025-06-27 13:37:26 -05:00
test_slru Widen MultiXactOffset to 64 bits 2025-12-09 13:53:03 +02:00
test_tidstore Move dynamically-allocated LWLock tranche names to shared memory. 2025-09-03 13:57:48 -05:00
typcache Fix failures with cross-version pg_upgrade tests 2025-12-10 12:46:45 +09:00
unsafe_tests Fix GUC check_hook validation for synchronized_standby_slots. 2025-10-27 06:48:32 +00:00
worker_spi Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
xid_wraparound Fix bogus extra arguments to query_safe in test 2025-12-10 19:38:07 +02:00
Makefile Fix O_CLOEXEC flag handling in Windows port. 2025-12-10 09:01:35 +13:00
meson.build Fix O_CLOEXEC flag handling in Windows port. 2025-12-10 09:01:35 +13:00
README Add an enforcement mechanism for global object names in regression tests. 2019-06-29 11:34:00 -04:00

Test extensions and libraries
=============================

src/test/modules contains PostgreSQL extensions that are primarily or entirely
intended for testing PostgreSQL and/or to serve as example code. The extensions
here aren't intended to be installed in a production server and aren't suitable
for "real work".

Furthermore, while you can do "make install" and "make installcheck" in
this directory or its children, it is NOT ADVISABLE to do so with a server
containing valuable data.  Some of these tests may have undesirable
side-effects on roles or other global objects within the tested server.
"make installcheck-world" at the top level does not recurse into this
directory.

Most extensions have their own pg_regress tests or isolationtester specs. Some
are also used by tests elsewhere in the tree.

If you're adding new hooks or other functionality exposed as C-level API this
is where to add the tests for it.