阿姆斯特丹Datapunt postgres表分区模块
项目描述
# pg_partition
用于分区新的/现有的PostgreSQL数据库表的实用程序。数据可以迁移。只支持日期范围分区类型。
必需的环境变量
```
DATABASE_HOST : PostgreSQL服务器的主机名/ip
DATABASE_NAME : 要操作的数据库名称
DATABASE_USER : PostgreSQL登录
DATABASE_PASSWORD : PostgreSQL密码
```
#### 安装 ####
```
pip install -r requirements.txt
```
#### 使用方法 ####
```
用法:pg_partition.py [-h] {create,add} ...
位置参数
{create,add}
可选参数
-h, --help 显示此帮助信息并退出
```
#### 创建用法 ####
```
用法:pg_partition.py create [-h] [--type {day,week,month}] table column
位置参数
table 要分区的表
column 用于范围的列
可选参数
-h, --help 显示此帮助信息并退出
--type {day,week,month}
```
#### 添加用法 ####
```
用法:pg_partition.py add [-h] [--num NUM] [--date DATE]
table {day,week,month}
位置参数
table 要分区的表
{day,week,month}
可选参数
-h, --help 显示此帮助信息并退出
--num NUM 要创建的分区数量
--date DATE 开始日期(yyyymmdd)
```
#### 创建分区 ####
```
# 通过'column'将'table'转换为基于'column'的范围分区表
# 不迁移数据
python pg_partition.py create table column
# 通过'column'将'table'转换为基于'column'的范围分区表
# 数据在周分区中迁移
python pg_partition.py create table column --type week
```
#### 添加分区 ####
```
# 向'table'添加从20180101开始的10个天分区
python pg_partition.py add table day --num 10 --date 20180101
```
用于分区新的/现有的PostgreSQL数据库表的实用程序。数据可以迁移。只支持日期范围分区类型。
必需的环境变量
```
DATABASE_HOST : PostgreSQL服务器的主机名/ip
DATABASE_NAME : 要操作的数据库名称
DATABASE_USER : PostgreSQL登录
DATABASE_PASSWORD : PostgreSQL密码
```
#### 安装 ####
```
pip install -r requirements.txt
```
#### 使用方法 ####
```
用法:pg_partition.py [-h] {create,add} ...
位置参数
{create,add}
可选参数
-h, --help 显示此帮助信息并退出
```
#### 创建用法 ####
```
用法:pg_partition.py create [-h] [--type {day,week,month}] table column
位置参数
table 要分区的表
column 用于范围的列
可选参数
-h, --help 显示此帮助信息并退出
--type {day,week,month}
```
#### 添加用法 ####
```
用法:pg_partition.py add [-h] [--num NUM] [--date DATE]
table {day,week,month}
位置参数
table 要分区的表
{day,week,month}
可选参数
-h, --help 显示此帮助信息并退出
--num NUM 要创建的分区数量
--date DATE 开始日期(yyyymmdd)
```
#### 创建分区 ####
```
# 通过'column'将'table'转换为基于'column'的范围分区表
# 不迁移数据
python pg_partition.py create table column
# 通过'column'将'table'转换为基于'column'的范围分区表
# 数据在周分区中迁移
python pg_partition.py create table column --type week
```
#### 添加分区 ####
```
# 向'table'添加从20180101开始的10个天分区
python pg_partition.py add table day --num 10 --date 20180101
```
项目详情
关闭
哈希值 for datapunt-pg-partitioning-2019.2.27.3.tar.gz
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 7e0c5e2ea58768e06a95485153544b94f1d1c4c380d840b327873789f7db788d |
|
MD5 | 608ceccfe9afcae699e06c4fbd714729 |
|
BLAKE2b-256 | 050c9cd7cd4f491850e0bc448a5664eba440d05fa94c3793782ac9f943378f9e |
关闭
哈希值 for datapunt_pg_partitioning-2019.2.27.3-py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0db846da5ea39163c888e8dda4c59cc234545fd1cc0e817bc50fb91d8399a6c6 |
|
MD5 | 5fe1fe8e3c286ca7612b5d5d844f06ab |
|
BLAKE2b-256 | 9d60706a64de884a5cba0e60572feac1b2e91480eccb144f31afa66bcd04bc39 |