migrate-postgres-tables-to-hypertables

仓库创建 2025年7月24日最近提交 1 个月前SkillHot 收录 22 天前
▸ 精选理由

提供可验证的迁移流程,降低停机与性能风险,适合时序化改造。

▸ 风险提示

在生产环境执行 DDL/迁移存在数据与锁定风险

这个 Skill 做什么

将 PostgreSQL 表迁移为 TimescaleDB hypertable,含配置与验证步骤。

把选定的 PostgreSQL 表迁移成 TimescaleDB 的 hypertable,做到配置最优、停机最少并验证迁移成功。常用于时序数据量大、需要压缩和分区的场景,支持蓝绿迁移、大表无痛转换、并在迁移后配置 compression。特色是给出可执行的 SQL 步骤、验证方法和性能优化建议。

▸ 展开 SKILL.md 英文原文

Use this skill to migrate identified PostgreSQL tables to Timescale/TimescaleDB hypertables with optimal configuration and validation. **Trigger when user asks to:** - Migrate or convert PostgreSQL tables to hypertables - Execute hypertable migration with minimal downtime - Plan blue-green migration for large tables - Validate hypertable migration success - Configure compression after migration **Prerequisites:** Tables already identified as candidates (use find-hypertable-candidates first if needed) **Keywords:** migrate to hypertable, convert table, Timescale, TimescaleDB, blue-green migration, in-place conversion, create_hypertable, migration validation, compression setup Step-by-step migration planning including: partition column selection, chunk interval calculation, PK/constraint handling, migration execution (in-place vs blue-green), and performance validation queries.

开发编程TimescaleDB迁移无停机通用
1.8k
Stars
100
Forks
10
仓库内 Skill
+14
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/timescale/pg-aiguide/main/skills/migrate-postgres-tables-to-hypertables/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/timescale/pg-aiguide/main/skills/migrate-postgres-tables-to-hypertables/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# PostgreSQL to TimescaleDB Hypertable Migration

Migrate identified PostgreSQL tables to TimescaleDB hypertables with optimal configuration, migration planning and validation.

**Prerequisites**: Tables already identified as hypertable candidates (use companion "find-hypertable-candidates" skill if needed).

## Step 1: Optimal Configuration

### Partition Column Selection

```sql
-- Find potential partition columns
SELECT column_name, data_type, is_nullable
FROM information_schema.columns
WHERE table_name = 'your_table_name'
  AND data_type IN ('timestamp', 'timestamptz', 'bigint', 'integer', 'date')
ORDER BY ordinal_position;
```

**Requirements:** Time-based (TIMESTAMP/TIMESTAMPTZ/DATE) o
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有