You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] 5.4-SNAPSHOT: PostgreSQL ATTACH/DETACH PARTITION is only UNSPECIFIC #2523
PostgreSQL ALTER TABLE ... ATTACH PARTITION and DETACH PARTITION are accepted only by the generic fallback. The resulting AlterExpression has AlterOperation.UNSPECIFIC, getParameters() is null, and none of the partition name, bound, CONCURRENTLY, or FINALIZE data is available structurally.
On JSqlParser 5.4-SNAPSHOT at 9a32ff568f580178d9a27b101596aa43eb45d0b7, all forms return an Alter, but the first AlterExpression reports:
operation = UNSPECIFIC
parameters = null
The original text happens to deparse through captureRest, but callers cannot inspect or modify the operation safely.
Expected behavior
Use dedicated alter operations and structured fields for the partition table name, RANGE/LIST/HASH/DEFAULT bound, and DETACH mode. Parsing and both deparsing paths should retain all tokens.
Software information and server validation
JSqlParser: 5.4-SNAPSHOT
Database: PostgreSQL 18.6 (postgres:18)
A standalone table was successfully attached to a RANGE-partitioned parent, detached, reattached, and detached with CONCURRENTLY using ON_ERROR_STOP=1.
OpenAI Codex was used to assemble and execute the parser/server comparison. The cases were checked against the PostgreSQL 18 documentation and an actual PostgreSQL 18.6 server.
Activity