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
EQL intentionally reinstalls its disposable eql_v3 and eql_v3_internal schemas with DROP SCHEMA ... CASCADE. Encrypted data remains safe because every data-bearing column domain lives in public, but PostgreSQL also removes customer-owned objects that depend on disposable EQL functions or types.
Functional search indexes then disappear silently and queries fall back to sequential scans. Policies, constraints, views, generated expressions, triggers, and unknown dependency classes are more dangerous because their meaning cannot be safely reconstructed automatically.
Decision
Keep the EQL v2 persistence boundary. Do not introduce object-by-object upgrade scripts or per-release schemas.
Teach stash eql upgrade and force-install to use one safe-reinstall protocol:
Acquire an advisory lifecycle lock.
Discover dependency paths from eql_v3 and eql_v3_internal to customer-owned objects.
Allowlist reconstructable functional indexes and capture complete pg_get_indexdef() definitions.
Abort before mutation for any policy, constraint, view, generated expression, trigger, or unknown dependency; print the complete inventory.
Execute the shipped installer transactionally.
Recreate captured indexes and ANALYZE affected tables.
Verify every index exists, is valid/ready, matches its definition, and engages through EQL validation.
Exit non-zero with exact recovery SQL if reconstruction fails.
Acceptance criteria
Reinstall with no external dependencies succeeds.
Supported functional indexes are captured, rebuilt, and verified.
Unique, partial, quoted-name, non-public-schema, partitioned, included-column, tablespace, and storage-parameter cases are tested and allowlisted or rejected before mutation.
Policies, constraints, views, generated columns, triggers, and unknown dependencies abort before schema drop.
Installer failure leaves the previous installation and indexes intact.
Reconstruction failure is loud, actionable, and safe to retry.
The command never reports success with a captured index missing or invalid.
Related work
#959 proves install, uninstall, and reinstall never lose encrypted data. This issue owns derived indexes and every non-data dependency affected by disposable schema replacement.
Problem
EQL intentionally reinstalls its disposable
eql_v3andeql_v3_internalschemas withDROP SCHEMA ... CASCADE. Encrypted data remains safe because every data-bearing column domain lives inpublic, but PostgreSQL also removes customer-owned objects that depend on disposable EQL functions or types.Functional search indexes then disappear silently and queries fall back to sequential scans. Policies, constraints, views, generated expressions, triggers, and unknown dependency classes are more dangerous because their meaning cannot be safely reconstructed automatically.
Decision
Keep the EQL v2 persistence boundary. Do not introduce object-by-object upgrade scripts or per-release schemas.
Design:
docs/superpowers/specs/2026-08-31-eql-safe-reinstall-design.mdADR:
docs/adr/0001-eql-data-survives-disposable-schema-reinstall.mdImplementation
Teach
stash eql upgradeand force-install to use one safe-reinstall protocol:eql_v3andeql_v3_internalto customer-owned objects.pg_get_indexdef()definitions.ANALYZEaffected tables.Acceptance criteria
Related work
#959 proves install, uninstall, and reinstall never lose encrypted data. This issue owns derived indexes and every non-data dependency affected by disposable schema replacement.