Bug Description
Applying a Schema Diff script that updates a function or procedure leaves a whitespace-only difference behind, so comparing the two databases again still reports the object as different unless 'Ignore whitespace' is ticked.
The generated CREATE OR REPLACE wraps the body in newlines:
CREATE OR REPLACE PROCEDURE test_schema_diff.proc1(
IN arg1 bigint)
LANGUAGE 'sql'
AS $BODY$
select 1;
$BODY$;
so the target's prosrc becomes "\nselect 1;\n" whilst the source's remains "select 1;". The bodies now differ by exactly the newlines pgAdmin itself introduced, and the comparison duly reports it.
It is cosmetic in that the two functions behave identically, and ticking 'Ignore whitespace' hides it, but a script that cannot settle the difference it was generated for is confusing: re-running the comparison suggests the script did not work.
Expected Behaviour
Applying the generated script should leave the object comparing as identical without needing 'Ignore whitespace', which means either rendering the body exactly as it is stored, or normalising the stored body on both sides before comparing.
Context
Found by making the Schema Diff regression test assert that applying the generated script leaves the two databases identical (#10293). The test lists this as a known outstanding difference until it is fixed.
Bug Description
Applying a Schema Diff script that updates a function or procedure leaves a whitespace-only difference behind, so comparing the two databases again still reports the object as different unless 'Ignore whitespace' is ticked.
The generated
CREATE OR REPLACEwraps the body in newlines:so the target's
prosrcbecomes"\nselect 1;\n"whilst the source's remains"select 1;". The bodies now differ by exactly the newlines pgAdmin itself introduced, and the comparison duly reports it.It is cosmetic in that the two functions behave identically, and ticking 'Ignore whitespace' hides it, but a script that cannot settle the difference it was generated for is confusing: re-running the comparison suggests the script did not work.
Expected Behaviour
Applying the generated script should leave the object comparing as identical without needing 'Ignore whitespace', which means either rendering the body exactly as it is stored, or normalising the stored body on both sides before comparing.
Context
Found by making the Schema Diff regression test assert that applying the generated script leaves the two databases identical (#10293). The test lists this as a known outstanding difference until it is fixed.