Repository navigation
Conversation
…as two unrelated functions. pgadmin-org#10597 Schema Diff matched functions and procedures on a name that included their input argument names, so renaming an input argument produced a Source Only/Target Only pair, and the generated CREATE OR REPLACE was rejected by PostgreSQL before the old function was dropped. Functions and procedures are now matched on their name and input argument types, as PostgreSQL identifies them, whilst still being shown under their name with argument names (the source's, for a Different object). When the input argument names differ, the target is dropped and recreated from the source. Closes pgadmin-org#10597
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughSchema Diff now matches functions and procedures by name and input argument types, while displaying titles that include input argument names and exclude ChangesFunction and procedure signature matching
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant FunctionQueries
participant DirectoryCompare
participant FunctionComparison
participant SchemaDiffSQL
FunctionQueries->>DirectoryCompare: Return name and diff_key
DirectoryCompare->>FunctionComparison: Compare objects matched by diff_key
FunctionComparison->>SchemaDiffSQL: Drop and recreate when input argument names differ
Merge Risk: 🔵 Low · up to
|
|
Squashed and merged as 6594977. |
Schema Diff matched functions and procedures on a name that included their input argument names, so renaming an input argument produced a Source Only/Target Only pair, and the generated
CREATE OR REPLACEwas rejected by PostgreSQL (cannot change name of input parameter) before the old function was dropped.oidvectortypes(proargtypes)), which is how PostgreSQL identifies them.directory_comparegains a small, generic way for a node to supply a display title separate from its match key; the title is never compared.The EPAS templates got the same change but are untested locally.
Test plan
tools.schema_diff.tests.test_schema_diff_function_signaturewith renamed IN and INOUT arguments, an unnamed-to-named argument and a renamed procedure argument; it checks the title, the DROP before CREATE, and that the target compares as Identical after the script is appliedtools.schema_diffpackage (9 tests) and the functions node package (78 tests) on PostgreSQL 18Closes #10597
Summary by CodeRabbit