eulerto / pgquarrel

pgquarrel compares PostgreSQL database schemas (DDL)
BSD 3-Clause "New" or "Revised" License
388 stars 42 forks source link

DROP of function with DEFAULT has syntax error. #32

Closed esgibsondxc closed 7 years ago

esgibsondxc commented 7 years ago

The DROP statement generated when a function parameter has a DEFAULT causes a syntax error in the output script. Encountered in postgresql 9.6

example drop for foo(arg1 integer DEFAULT 1::integer)

DROP FUNCTION foo(arg1 integer DEFAULT 1::integer);

Should be

DROP FUNCTION foo(arg1 integer);

OR

DROP FUNCTION foo(integer);

eulerto commented 7 years ago

@esgibsondxc Could you test again?

esgibsondxc commented 7 years ago

Now the generated DROP FUNCTIONS look correct.