Skip to main content

pg-write-trace-skill

Traces PostgreSQL C source code to identify which system catalogs (e.g., pg_class, pg_attribute) are modified (inserted, updated, or deleted) by a specific handler function. Use this to find the side-effects of a DDL statement.

설치로 이동

소스 정보

저장소
bytebase/omni
최근 소스 활동
2026년 3월 21일 08:32
감지된 SKILL.md 언어
영어
스타
13
포크
6

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
pg-write-trace-skill
description
Traces PostgreSQL C source code to identify which system catalogs (e.g., pg_class, pg_attribute) are modified (inserted, updated, or deleted) by a specific handler function. Use this to find the side-effects of a DDL statement.
> Deprecated: use `pg/semantic/SKILL.md` and the staged pipeline under `pg/semantic/` instead. # PostgreSQL Write Trace Skill You are a PostgreSQL kernel expert specializing in the Storage and Catalog layers. Your task is to identify the **side-effects** (mutations) of a PostgreSQL handler function on the system catalogs. This is Step 2 of building the PostgreSQL Semantic Fidelity Pipeline. ## Your Task 1. Receive a PostgreSQL C handler function (e.g., `DefineRelation`). 2. Recursively trace the function's call graph in the PostgreSQL source code. 3. Identify all points where system catalog tuples are modified. 4. Output the results in structured JSON. ## Target Functions (PG Internal) Look for calls to these core catalog modification functions: - `heap_insert`, `CatalogTupleInsert` - `simple_heap_update`, `CatalogTupleUpdate` - `simple_heap_delete`, `CatalogTupleDelete` - `recordDependencyOn`, `recordMultipleDependencies` (modifies `pg_depend`) ## Search Strategy - Search for the handler function definition (e.g., `void DefineRelation(...)`). - Follow sub-calls into functions that modify catalogs (e.g., `InsertPgClassTuple`). - Identify the specific OIDs of the affected system tables. ## Expected Output Format ```json { "handler": "DefineRelation", "modifies": [ { "catalog": "pg_class", "operation": "insert", "trigger": "InsertPgClassTuple" }, { "catalog": "pg_attribute", "operation": "insert", "trigger": "AddNewAttribute" }, { "catalog": "pg_type", "operation": "insert", "trigger": "TypeCreate" }, { "catalog": "pg_depend", "operation": "insert", "trigger": "recordDependencyOn" } ] } ``` ## Guidelines - Be as specific as possible about which catalogs are touched. - Distinguish between "primary" modifications (the main object) and "secondary" ones (dependencies, types, arrays). - If the mutation is conditional (e.g., only if `IF NOT EXISTS` is not used), note the condition if possible.
GitHub에서 보기