Postgres Partitioner is a PHP-based tool that helps to generate partition tables in PostgreSQL using an existing table.
It currently supports range partitioning based on a specified column.
- Automatically create range partitions for a specified table and column.
- Easy configuration via a configuration file.
- Simple command-line interface for executing partitioning tasks.
- Documentation: 16: 5.11. Table Partitioning
- How to use table partitioning to scale PostgreSQL - EDB
- What is partitioning?
- PHP 7.4 or higher
- Composer
- PostgreSQL
- PDO extension for PostgreSQL
-
Clone the repository:
git clone https://github.com/usmonaliyev99/postgres-partitioner.git cd postgres-partitioner
-
Install dependencies using Composer:
composer install
-
Create and configure the database credentials in
.env
:DB_HOST=127.0.0.1 DB_PORT=5432 DB_NAME= DB_USER= DB_PASSWORD=
The main script for partitioning is bin/range.php
.
You can run it from the terminal as follows:
./bin/range.php <table_name> <column_name>
Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for more details.