Repository navigation
Name an extension used through an array or a domain in the data copy preflight (S-007-7) - #176
Merged
Conversation
…preflight (S-007-7) A citext[] column depends on the array type _citext, which depends on citext with deptype 'i', not on the extension, so the preflight's needed CTE never reached the extension member: citext was neither reported under extensions nor passed to pg_dump --extension, and the restore failed. The query now walks every type a selected object references to its array element type (typcategory 'A', typelem) and its domain base type (typbasetype), chained, before matching extension members, in the one psql-variable-parameterised query that feeds both lists. Fixes #173 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue #173, item 1. The data copy preflight's
neededCTE matched an extension only when a selected object depends directly on one of its members (pg_depend,deptype = 'e'). Acitext[]column depends on the array type_citext, and_citextdepends oncitextwithdeptype = 'i', not on the extension. Socitextwas neither reported underextensions(S-007-7) nor passed topg_dump --extension. The same gap hit a column of a domain overcitextwhen the domain lives outside the selected schemas.The fix adds a recursive
referenced(classid, objid)CTE. It starts from every object a selected object depends on, then walks each type to its array element type (typcategory = 'A',typelem) and to its domain base type (typtype = 'd',typbasetype), chained. Only then does it match extension members. This is still the one query that feeds both theextensionsfinding and the--extensionlist; it only gainsWITH RECURSIVE. Names still arrive only as psql variables, and the shape of the finding lists is unchanged.Out of scope, moved to #175: extensions installed in an unselected schema, and
auth.references in foreign keys, defaults and views.Plan
engine/ansible/roles/cloudfall_data_migration/defaults/main.yml,engine/tests/test_data_migration_role.py,changelog.d/173-preflight-extension-arrays.mdcitext[]column and a domain overcitextmust namecitext), then theneededCTE follows array element and domain base types before matching extension memberstest_s007_7_an_array_or_domain_of_an_extension_type_names_itfails on main and passes after (S-007-7); ruff, mypy, ansible-lint and the touched test files passTest notes
New
test_s007_7_an_array_or_domain_of_an_extension_type_names_it(rendered SQL): fails on main, passes hereuv run pytest engine/tests/test_data_migration_role.py sdk/tests/test_data_copy_preflight.py: 28 passeduv run ruff check .,uv run mypy, andANSIBLE_CONFIG=engine/ansible/ansible.cfg uv run ansible-lint engine/ansible(as CI runs it) all passLive check, outside the suite: I ran both main's query and this branch's query on a throwaway PostgreSQL 16.2 (the
pgserverwheel), with schemaappselected and the extension installed in an unselected schema. That build has no contrib, so pgvector'svectorstood in forcitext; it has the same shape, an extension base type with an implicit array type. Results:app.tcolumnvector["vector"]["vector"]vector[][]["vector"]vector[]["vector"][]["vector"][]["vector"]integer[][][]The full suite is left to CI
Fixes #173
🤖 Generated with Claude Code