[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71SAMF7BF50KR47MPY3CH48":3,"skill-same:01M71SAMF7BF50KR47MPY3CH48":100},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":57,"repositoryHtmlUrl":58,"repositoryHomepageUrl":59,"ownerHtmlUrl":60,"ownerBlogUrl":61,"ownerDescription":62,"updatedAt":63,"install":64,"resources":77},"01M71SAMF7BF50KR47MPY3CH48","postgresql-table-design",null,"Design or review a PostgreSQL-specific schema: data types, indexing, constraints, partitioning, RLS, performance patterns, and advanced features","HigorAlves\u002Forc","HigorAlves","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F11262976?v=4","01M71S79EZEMHZ8PQSV0XQJHYY","Higor Alves","01M71S79FKKTCHCN1EDR8DSTWQ",7,"MIT","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Fpostgresql-table-design\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"design","postgresql","table","postgresql table design","constraints","use","schema","tables","patterns","data","modeling","features","indexing","review","rls","when","performance","advanced","types","2026-11-10 13:02:02",false,"---\nname: postgresql-table-design\ndescription: \"Design or review a PostgreSQL-specific schema: data types, indexing, constraints, partitioning, RLS, performance patterns, and advanced features\"\nwhen_to_use: Use when modeling or auditing PG tables.\n---\n\n# PostgreSQL Table Design\n\nThis SKILL.md is a thin index — the Core Rules and Gotchas below cover most design\u002Freview calls; Read the relevant `references\u002F*.md` on demand for the rest, never all up front.\n\n## Core Rules\n\n- Define a **PRIMARY KEY** for reference tables (users, orders, etc.). Not always needed for time-series\u002Fevent\u002Flog data. When used, prefer `BIGINT GENERATED ALWAYS AS IDENTITY`; use `UUID` only when global uniqueness\u002Fopacity is needed.\n- **Normalize first (to 3NF)** to eliminate data redundancy and update anomalies; denormalize **only** for measured, high-ROI reads where join performance is proven problematic. Premature denormalization creates maintenance burden.\n- Add **NOT NULL** everywhere it's semantically required; use **DEFAULT**s for common values.\n- Create **indexes for access paths you actually query**: PK\u002Funique (auto), **FK columns (manual!)**, frequent filters\u002Fsorts, and join keys.\n- Prefer **TIMESTAMPTZ** for event time; **NUMERIC** for money; **TEXT** for strings; **BIGINT** for integer values, **DOUBLE PRECISION** for floats (or `NUMERIC` for exact decimal arithmetic).\n\n## PostgreSQL \"Gotchas\"\n\n- **Identifiers**: unquoted → lowercased. Avoid quoted\u002Fmixed-case names. Convention: `snake_case` for table\u002Fcolumn names.\n- **Unique + NULLs**: UNIQUE allows multiple NULLs. Use `UNIQUE (...) NULLS NOT DISTINCT` (PG15+) to restrict to one NULL.\n- **FK indexes**: PostgreSQL **does not** auto-index FK columns. Add them.\n- **No silent coercions**: length\u002Fprecision overflows error out (no truncation).\n- **Sequences\u002Fidentity have gaps** (normal; don't \"fix\").\n- **Heap storage**: no clustered PK by default; `CLUSTER` is one-off, not maintained.\n- **MVCC**: updates\u002Fdeletes leave dead tuples; vacuum handles them — design to avoid hot wide-row churn.\n\n## Detail map (read on demand)\n\n| Question | Reference |\n|----------|-----------|\n| Which type for X? Banned types (`char(n)`, `money`, `timestamp` w\u002Fo tz, `serial`)? Table types, generated columns | [DATA-TYPES.md](references\u002FDATA-TYPES.md) |\n| RLS, constraint shapes, which index kind (B-tree\u002FGIN\u002FGiST\u002FBRIN, partial, covering), when to partition | [INDEXING-CONSTRAINTS-PARTITIONING.md](references\u002FINDEXING-CONSTRAINTS-PARTITIONING.md) |\n| Update-heavy \u002F insert-heavy \u002F upsert designs, safe schema evolution, useful extensions | [WORKLOAD-PATTERNS.md](references\u002FWORKLOAD-PATTERNS.md) |\n| JSONB vs columns, indexing JSONB | [JSONB.md](references\u002FJSONB.md) |\n| Worked schemas (users, orders, JSONB) | [EXAMPLES.md](references\u002FEXAMPLES.md) |\n\nFor query-side work (JSONB operators, window functions, full-text search, PG-unique SQL) use `orc-postgresql-optimization` instead.\n","# PostgreSQL Table Design\n\nThis SKILL.md is a thin index — the Core Rules and Gotchas below cover most design\u002Freview calls; Read the relevant `references\u002F*.md` on demand for the rest, never all up front.\n\n## Core Rules\n\n- Define a **PRIMARY KEY** for reference tables (users, orders, etc.). Not always needed for time-series\u002Fevent\u002Flog data. When used, prefer `BIGINT GENERATED ALWAYS AS IDENTITY`; use `UUID` only when global uniqueness\u002Fopacity is needed.\n- **Normalize first (to 3NF)** to eliminate data redundancy and update anomalies; denormalize **only** for measured, high-ROI reads where join performance is proven problematic. Premature denormalization creates maintenance burden.\n- Add **NOT NULL** everywhere it's semantically required; use **DEFAULT**s for common values.\n- Create **indexes for access paths you actually query**: PK\u002Funique (auto), **FK columns (manual!)**, frequent filters\u002Fsorts, and join keys.\n- Prefer **TIMESTAMPTZ** for event time; **NUMERIC** for money; **TEXT** for strings; **BIGINT** for integer values, **DOUBLE PRECISION** for floats (or `NUMERIC` for exact decimal arithmetic).\n\n## PostgreSQL \"Gotchas\"\n\n- **Identifiers**: unquoted → lowercased. Avoid quoted\u002Fmixed-case names. Convention: `snake_case` for table\u002Fcolumn names.\n- **Unique + NULLs**: UNIQUE allows multiple NULLs. Use `UNIQUE (...) NULLS NOT DISTINCT` (PG15+) to restrict to one NULL.\n- **FK indexes**: PostgreSQL **does not** auto-index FK columns. Add them.\n- **No silent coercions**: length\u002Fprecision overflows error out (no truncation).\n- **Sequences\u002Fidentity have gaps** (normal; don't \"fix\").\n- **Heap storage**: no clustered PK by default; `CLUSTER` is one-off, not maintained.\n- **MVCC**: updates\u002Fdeletes leave dead tuples; vacuum handles them — design to avoid hot wide-row churn.\n\n## Detail map (read on demand)\n\n| Question | Reference |\n|----------|-----------|\n| Which type for X? Banned types (`char(n)`, `money`, `timestamp` w\u002Fo tz, `serial`)? Table types, generated columns | [DATA-TYPES.md](references\u002FDATA-TYPES.md) |\n| RLS, constraint shapes, which index kind (B-tree\u002FGIN\u002FGiST\u002FBRIN, partial, covering), when to partition | [INDEXING-CONSTRAINTS-PARTITIONING.md](references\u002FINDEXING-CONSTRAINTS-PARTITIONING.md) |\n| Update-heavy \u002F insert-heavy \u002F upsert designs, safe schema evolution, useful extensions | [WORKLOAD-PATTERNS.md](references\u002FWORKLOAD-PATTERNS.md) |\n| JSONB vs columns, indexing JSONB | [JSONB.md](references\u002FJSONB.md) |\n| Worked schemas (users, orders, JSONB) | [EXAMPLES.md](references\u002FEXAMPLES.md) |\n\nFor query-side work (JSONB operators, window functions, full-text search, PG-unique SQL) use `orc-postgresql-optimization` instead.\n",{"name":5,"description":7,"when_to_use":53},"Use when modeling or auditing PG tables.","main","7522fd7266944e30052204c2f6df287d8b5516be","codex\u002Forc\u002Fcontent\u002Fskills\u002Fpostgresql-table-design",0,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc","https:\u002F\u002Forc.novacstack.com\u002F","https:\u002F\u002Fgithub.com\u002FHigorAlves","higoralves.dev","Software Engineering","2026-11-07 07:26:38",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add HigorAlves\u002Forc --skill postgresql-table-design",{"tool":70,"command":71},"bunx","bunx skills add HigorAlves\u002Forc --skill postgresql-table-design",{"tool":73,"command":74},"pnpm","pnpm dlx skills add HigorAlves\u002Forc --skill postgresql-table-design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Fpostgresql-table-design\u002FSKILL.md",true,[78,84,88,92,96],{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002FDATA-TYPES.md","REFERENCE","参考文档",4641,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Fpostgresql-table-design\u002Freferences\u002FDATA-TYPES.md",{"path":85,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002FEXAMPLES.md",1003,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Fpostgresql-table-design\u002Freferences\u002FEXAMPLES.md",{"path":89,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":90,"sourceHtmlUrl":91},"references\u002FINDEXING-CONSTRAINTS-PARTITIONING.md",3642,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Fpostgresql-table-design\u002Freferences\u002FINDEXING-CONSTRAINTS-PARTITIONING.md",{"path":93,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":94,"sourceHtmlUrl":95},"references\u002FJSONB.md",1394,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Fpostgresql-table-design\u002Freferences\u002FJSONB.md",{"path":97,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":98,"sourceHtmlUrl":99},"references\u002FWORKLOAD-PATTERNS.md",3302,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Fpostgresql-table-design\u002Freferences\u002FWORKLOAD-PATTERNS.md",[101,135,161,182,204,224],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":116,"publishedAt":48},"01M71SW40F9TAAEDKBYYBCM814","writing-plans","Write a comprehensive implementation plan of bite-sized TDD tasks that an engineer with zero codebase context could execute — exact files, code, tests, and verification steps","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[107,110,113],{"categoryNo":108,"categoryName":109,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":111,"categoryName":112,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师",{"categoryNo":114,"categoryName":115,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000036","内容创作者",[117,118,119,120,121,122,123,44,124,125,126,127,128,129,130,131,132,133,134,34],"writing","writing plans","plans","engineer","superpowers","implementation plan","files","you","code","tasks","verification","plan","write","steps","context","ZeRO","for","tests",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":146,"publishedAt":48},"01M71SW15KHE4MHJW9NEXV65X2","writing-for-agents","orc's doctrine layer for writing any document an agent consumes — skills, AGENTS.md\u002FCLAUDE.md, reference docs","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[141,142,145],{"categoryNo":108,"categoryName":109,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":143,"categoryName":144,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":114,"categoryName":115,"taxonomyType":26,"taxonomyTypeDesc":27},[147,117,133,148,44,149,150,151,152,153,154,155,34,156,157,158,159,160],"writing for agents","matt pocock","inline","tuning","a skill","layer","doctrine","push","editing","document","github","https","reference","docs",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":168,"publishedAt":48},"01M71SVYQKXT743HHHWGHT3G13","workspace-mode","Use when cwd is a parent dir holding multiple sibling git repos — defines repo auto-detection, --repos\u002F--repo\u002F--all-repos\u002F--this-repo precedence, per-repo dispatch, and linked-PR mechanics.","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Fworkspace-mode\u002FSKILL.md",[167],{"categoryNo":143,"categoryName":144,"taxonomyType":21,"taxonomyTypeDesc":22},[169,170,171,172,173,44,174,175,176,177,34,178,179,180,181],"workspace mode","mode","workspace","mechanics","auto","repos","git","pr","repo","dispatch","auto-detection","detection","parent",{"skillNo":183,"name":184,"nameZh":6,"description":185,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":186,"categories":187,"keywords":189,"publishedAt":48},"01M71SVVP3BXS06G9395P2K0RH","wizard","Generate an interactive bash wizard walking a human through work only they can perform — credentials, secrets, one-off migrations","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Fwizard\u002FSKILL.md",[188],{"categoryNo":143,"categoryName":144,"taxonomyType":21,"taxonomyTypeDesc":22},[184,190,191,192,193,148,44,194,195,196,197,198,199,130,200,201,133,34,202,203],"condition","never","provisioning infrastructure","only","Bash","work","credentials","generate","human","secrets","infrastructure","do","one","interactive",{"skillNo":205,"name":206,"nameZh":6,"description":207,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":208,"categories":209,"keywords":210,"publishedAt":48},"01M71SVT4AR6NKAM5B077E7QSJ","wait-what","Stop and re-pitch — the last message did not land; say it again simply, in the project's own vocabulary.","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Fwait-what\u002FSKILL.md",[],[211,212,213,214,215,148,216,217,218,219,157,158,220,221,222,223],"wait what","wait","project","re","true","pitch","last","say","message","land","it","stop","vocabulary",{"skillNo":225,"name":226,"nameZh":6,"description":227,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":228,"categories":229,"keywords":234,"publishedAt":48},"01M71SVQVYRA9QBQ6G8MWR8G6F","vitest","Vitest fast unit testing framework powered by Vite with Jest-compatible API","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Fvitest\u002FSKILL.md",[230,233],{"categoryNo":231,"categoryName":232,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":111,"categoryName":112,"taxonomyType":26,"taxonomyTypeDesc":27},[226,235,236,237,238,239,117,44,240,241,242,243,244,245,246,247,248,249,134,250],"coverage","unit","testing","testing framework","generated","api","jest","2026","at","scripts","unit testing","antfu","framework","vite","mocking","dev"]