Skip to content

Conversation

@tianzhou
Copy link
Contributor

@tianzhou tianzhou commented Nov 6, 2025

Fix #144

Copilot AI review requested due to automatic review settings November 6, 2025 09:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes type qualification handling for PostgreSQL custom types to properly distinguish between extension types and user-defined types (GitHub #144, PR #145). The key change updates SQL queries to detect extension types via pg_depend and leave them unqualified for search_path resolution, while user-defined domains and enums are schema-qualified.

  • Modified type resolution logic in SQL queries to check pg_depend for extension types
  • Updated test data to validate the fix using citext extension, custom domain, and enum types
  • Consolidated type handling logic from separate conditions to a unified CASE expression

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ir/queries/queries.sql Added pg_depend join and updated type qualification logic to handle extension types separately
ir/queries/queries.sql.go Auto-generated code reflecting the SQL query changes
testdata/diff/create_table/add_column_custom_type/setup.sql Updated test setup to use citext extension instead of composite types
testdata/diff/create_table/add_column_custom_type/new.sql Updated test schema to include extension type, domain, and enum columns
testdata/diff/create_table/add_column_custom_type/plan.txt Updated expected plan output to reflect new type qualification behavior
testdata/diff/create_table/add_column_custom_type/plan.sql Updated expected DDL with qualified and unqualified type names
testdata/diff/create_table/add_column_custom_type/plan.json Updated expected JSON plan with new columns and type names
testdata/diff/create_table/add_column_custom_type/diff.sql Updated expected diff with qualified and unqualified type names

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tianzhou tianzhou force-pushed the extension_type_qualifier branch from 496e600 to e5fbfdf Compare November 6, 2025 09:24
@tianzhou tianzhou force-pushed the extension_type_qualifier branch from e5fbfdf to f8b05eb Compare November 6, 2025 09:46
@tianzhou tianzhou merged commit e99d0e5 into main Nov 6, 2025
2 checks passed
tianzhou added a commit that referenced this pull request Nov 7, 2025
tianzhou added a commit that referenced this pull request Nov 7, 2025
tianzhou added a commit that referenced this pull request Nov 7, 2025
* Revert "fix: extension qualifier (#146)"

This reverts commit e99d0e5.

* chore: adjust test case

* chore: only run setup script once
@tianzhou tianzhou deleted the extension_type_qualifier branch November 23, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

non-primitive types should be fully qualified in dumps to avoid planning errors

1 participant