eulerto / pgquarrel

pgquarrel compares PostgreSQL database schemas (DDL)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DROP of function with DEFAULT has syntax error.

esgibsondxc opened this issue · comments

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);

@esgibsondxc Could you test again?

Now the generated DROP FUNCTIONS look correct.