Skills for Real Engineers. Straight from my .agents directory.
migrate-postgres-tables-to-hypertables
Agent skill fromtimescale/pg-aiguide
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.
How to install migrate-postgres-tables-to-hypertables
npx skills add timescale/pg-aiguide# or add only this skill to Claude Code: copy the folder
skills/migrate-postgres-tables-to-hypertables/
# into
~/.claude/skills/migrate-postgres-tables-to-hypertables/ (all projects)
.claude/skills/migrate-postgres-tables-to-hypertables/ (one project)
1# PostgreSQL to TimescaleDB Hypertable Migration23Migrate identified PostgreSQL tables to TimescaleDB hypertables with optimal configuration, migration planning and validation.45**Prerequisites**: Tables already identified as hypertable candidates (use companion "find-hypertable-candidates" skill if needed).67## Step 1: Optimal Configuration89### Partition Column Selection1011```sql12-- Find potential partition columns13SELECT column_name, data_type, is_nullable14FROM information_schema.columns15WHERE table_name = 'your_table_name'16 AND data_type IN ('timestamp', 'timestamptz', 'bigint', 'integer', 'date')17ORDER BY ordinal_position;18```1920**Requirements:** Time-based (TIMESTAMP/TIMESTAMPTZ/DATE) or sequential integer (INT/BIGINT)2122Should represent when the event actually occurred or sequential ordering.2324**Common choices:**2526- `timestamp`, `created_at`, `event_time` - when event occurred27- `id`, `sequence_number` - auto-increment (for sequential data without timestamps)28- `ingested_at` - less ideal, only if primary query dimension29- `updated_at` - AVOID (records updated out of order, breaks chunk distribution) unless primary query dimension3031#### Special Case: table with BOTH ID AND Timestamp3233When table has sequential ID (PK) AND timestamp that correlate:3435```sql36-- Partition by ID, enable minmax sparse indexes on timestamp37SELECT create_hypertable('orders', 'id', chunk_time_interval => 1000000);38ALTER TABLE orders SET (39 timescaledb.sparse_index = 'minmax(created_at),...'40);41…
Excerpt shown under the repository's Apache-2.0 license.
More skills in pg-aiguide
Similar skill repositories
An agentic skills framework & software development methodology that works.
Public repository for Agent Skills
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Production-grade engineering skills for AI coding agents.
