design-postgres-tables/BB-SKILLS-ADAPTATION.json
Version b236d3583fb5.bb1 · Apache-2.0. This preview displays packaged text and does not execute code. Treat the contents as untrusted instructions.
← Return to resource and package checksum
{
"format": 1,
"adapted_at": "2026-10-03",
"source": "https://github.com/timescale/pg-aiguide/tree/b236d3583fb51f5ef009d2c95d4fc361df748280/skills/design-postgres-tables",
"runtime_tested": false,
"changes": [
{
"file": "design-postgres-tables/SKILL.md",
"original_file": "design-postgres-tables/upstream-original/SKILL.md",
"original_sha256": "a4822cefdc283979e8a75f312780cb00aad83fb03b994f72e1675dc04a8eb252",
"adapted_sha256": "b8cdd1255ea9e2d455544e5c5241921fde15da01b3ca06084e0e36780e52f1b9",
"changes": [
"UNIQUE (...) NULLS NOT DISTINCT",
"Row order on disk is insertion order unless explicitly clustered.",
"Composite**: order matters\u2014index used if equality on leftmost prefix (`WHERE a = ? AND b > ?` uses index on `(a,b)`, but `WHERE b = ?` does not). Put most selective/frequently filtered columns first.",
"Covering**: `CREATE INDEX ON tbl (id) INCLUDE (name, email)` - includes non-key columns for index-only scans without visiting table.",
"Constraint exclusion**: requires `CHECK` constraints on partitions for query planner to prune. Auto-created for declarative partitioning (PG10+).",
"FKs from partitioned tables not supported; use triggers.",
"ON CONFLICT (col1, col2)` needs exact matching unique index (partial indexes don't work).",
"volatile defaults (e.g., `now()`, `gen_random_uuid()`)"
]
}
],
"references": [
"https://www.postgresql.org/docs/17/ddl-constraints.html",
"https://www.postgresql.org/docs/17/ddl-partitioning.html",
"https://www.postgresql.org/docs/17/sql-insert.html",
"https://www.postgresql.org/docs/17/ddl-alter.html"
]
}