This project has been archived by its maintainers, and is no longer receiving any updates.
Utility to partition new/existing PostgreSql database tables. Data can be migrated. Only date range partition type is supported.
Required environment variables:
```
DATABASE_HOST : hostname/ip of the PostgreSql server
DATABASE_NAME : database to operate on
DATABASE_USER : PostgreSql login
DATABASE_PASSWORD : PostgreSql password
```
#### Install ####
```
pip install -r requirements.txt
```
#### Usage ####
```
usage: pg_partition.py [-h] {create,add} ...
positional arguments:
{create,add}
optional arguments:
-h, --help show this help message and exit
```
#### Create Usage ####
```
usage: pg_partition.py create [-h] [--type {day,week,month}] table column
positional arguments:
table table to be partitioned
column column to be used for range
optional arguments:
-h, --help show this help message and exit
--type {day,week,month}
```
#### Add Usage ####
```
usage: pg_partition.py add [-h] [--num NUM] [--date DATE]
table {day,week,month}
positional arguments:
table table to be partitioned
{day,week,month}
optional arguments:
-h, --help show this help message and exit
--num NUM partitions to create
--date DATE start date (yyyymmdd)
```
#### Creating partitions ####
```
# Convert 'table' to a range partitioned table by 'column'
# No data is migrated
python pg_partition.py create table column
# Convert 'table' to a range partitioned table by 'column'
# Data is migrated in week partitions
python pg_partition.py create table column --type week
```
#### Adding partitions ####
```
# Adds 10 day partitions starting from 20180101 to 'table'
python pg_partition.py add table day --num 10 --date 20180101
```
Metadata
Release files for datapunt-pg-partitioning 2019.2.27.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datapunt-pg-partitioning-2019.2.27.3.tar.gz | 5.5 kB | Without provenance | Details for datapunt-pg-partitioning-2019.2.27.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datapunt_pg_partitioning-2019.2.27.3-py3-none-any.whl | Python 3 | none | any | Details for datapunt_pg_partitioning-2019.2.27.3-py3-none-any.whl |
Total release size: 21.0 kB
Release files / datapunt-pg-partitioning-2019.2.27.3.tar.gz
| Download URL | datapunt-pg-partitioning-2019.2.27.3.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e0c5e2ea58768e06a95485153544b94f1d1c4c380d840b327873789f7db788d
|
|
BLAKE2b-256 checksum How to use checksums |
050c9cd7cd4f491850e0bc448a5664eba440d05fa94c3793782ac9f943378f9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
|
Release files / datapunt_pg_partitioning-2019.2.27.3-py3-none-any.whl
| Download URL | datapunt_pg_partitioning-2019.2.27.3-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0db846da5ea39163c888e8dda4c59cc234545fd1cc0e817bc50fb91d8399a6c6
|
|
BLAKE2b-256 checksum How to use checksums |
9d60706a64de884a5cba0e60572feac1b2e91480eccb144f31afa66bcd04bc39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
|
Security for datapunt-pg-partitioning 2019.2.27.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.