Schema Verify Via Information Schema

Use when about to write or execute SQL against a PostgreSQL/TimescaleDB table whose exact schema (column names, types, deprecated-vs-active-variant) is not 100% certain from current context — especially in forensic debugging where multiple tables have similar names (`ohlcv_1d` vs `ohlcv_1d_hist`, `users` vs `users_v2`) or column names have shifted over time. Iron-Law: `SELECT column_name, data_type FROM information_schema.columns WHERE table_name=$1 ORDER BY ordinal_position` is the cheapest 30-second insurance against UndefinedColumn, false-positive-empty-result, and wrong-table-queried. Trigger on phrases like "writing a query against table X", "UndefinedColumn", "column X does not exist", "verify DB schema", "I think the column is called Y", "before any forensic query". Do NOT load for ORM-mediated queries (SQLAlchemy/Django catch drift at model-load), first-time-schema-design, catalog-queries on information_schema itself, or connection issues.

Ed3Design 50634fd 7.6 KB Updated

File contents

Ed3Design/ed3design-skill-bundles/tree/main/schema-discipline/skills/schema-verify-via-information-schema commit 50634fdbcb

Frequently asked questions

npx skillmds@latest add ed3design/schema-verify-via-information-schema