|
| 1 | +# PostgreSQL 13-to-14 AST Transformer Status |
| 2 | + |
| 3 | +## Current Test Results |
| 4 | +- **Tests Passing**: 235/258 (91.1%) |
| 5 | +- **Tests Failing**: 23/258 (8.9%) |
| 6 | +- **Last Updated**: June 28, 2025 |
| 7 | + |
| 8 | +## Test Status Summary |
| 9 | +The 13-14 transformer is in good shape with 235 out of 258 tests passing. The remaining 23 failures are primarily edge cases and specialized PostgreSQL features. |
| 10 | + |
| 11 | +## Failure Categories |
| 12 | + |
| 13 | +### 1. objfuncargs Creation Issues (8 failures) |
| 14 | +- `original-upstream-object_address.test.ts` - CreateTransformStmt objfuncargs creation |
| 15 | +- `latest-postgres-create_cast.test.ts` - CreateCastStmt objfuncargs creation |
| 16 | +- `original-upstream-create_cast.test.ts` - CreateCastStmt objfuncargs creation |
| 17 | +- `original-upstream-alter_table.test.ts` - AlterTableStmt objfuncargs creation |
| 18 | +- Related to context-aware objfuncargs generation logic |
| 19 | + |
| 20 | +### 2. Parameter Name Issues (3 failures) |
| 21 | +- `original-drops.test.ts` - Unwanted parameter name "a" in DropStmt context |
| 22 | +- `original-upstream-polymorphism.test.ts` - Variadic parameter mode handling |
| 23 | +- Parameter names being added in contexts where they shouldn't exist |
| 24 | + |
| 25 | +### 3. Function Format Issues (3 failures) |
| 26 | +- `original-upstream-indirect_toast.test.ts` - funcformat should be COERCE_SQL_SYNTAX not COERCE_EXPLICIT_CALL |
| 27 | +- `latest-postgres-create_procedure.test.ts` - funcformat should be COERCE_SQL_SYNTAX not COERCE_EXPLICIT_CALL |
| 28 | +- `pg_catalog` prefix issues with substring function |
| 29 | + |
| 30 | +### 4. Node Wrapping Issues (2 failures) |
| 31 | +- `latest-postgres-create_table_like.test.ts` - Extra StatsElem wrapper |
| 32 | +- `original-upstream-portals.test.ts` - DeclareCursorStmt options value mismatch (274 vs 290) |
| 33 | + |
| 34 | +### 5. Syntax Errors (7 failures) |
| 35 | +These are PostgreSQL version compatibility issues where PG13 parser cannot handle newer syntax: |
| 36 | +- `latest-postgres-create_role.test.ts` - "OPTION" syntax |
| 37 | +- `latest-postgres-create_index.test.ts` - "NULLS" syntax |
| 38 | +- `latest-postgres-create_schema.test.ts` - "CURRENT_ROLE" syntax |
| 39 | +- `latest-postgres-create_am.test.ts` - "ACCESS" syntax |
| 40 | +- `misc-issues.test.ts` - "NULLS" syntax |
| 41 | + |
| 42 | +## Key Accomplishments |
| 43 | +- ✅ Context-aware function parameter handling |
| 44 | +- ✅ Variadic parameter detection and mode preservation |
| 45 | +- ✅ Enum mapping and transformation |
| 46 | +- ✅ objfuncargs creation for most contexts |
| 47 | +- ✅ Function format detection for most cases |
| 48 | +- ✅ Parameter name handling for most contexts |
| 49 | + |
| 50 | +## Known Issues to Address |
| 51 | +1. **objfuncargs Logic**: Need more precise context detection for when to create objfuncargs |
| 52 | +2. **Parameter Names**: Improve logic to avoid adding names in DropStmt and similar contexts |
| 53 | +3. **Function Formats**: Better detection of when to use COERCE_SQL_SYNTAX vs COERCE_EXPLICIT_CALL |
| 54 | +4. **Variadic Parameters**: Edge cases in polymorphic function handling |
| 55 | + |
| 56 | +## Stability Note |
| 57 | +⚠️ **DO NOT EDIT 13-14 CODE FURTHER** - To prevent regressions, the 13-14 transformer should be considered stable at 235/258 passing tests. Focus efforts on 14-15 transformer instead. |
| 58 | + |
| 59 | +## Architecture Strengths |
| 60 | +- Robust context propagation system |
| 61 | +- Comprehensive enum handling utilities |
| 62 | +- Systematic approach to node transformation |
| 63 | +- Good separation of concerns between transformation logic |
0 commit comments