DROP FUNCTION without knowing the number/type of parameters?

后端 未结 7 811
面向向阳花
面向向阳花 2020-12-01 02:20

I keep all my functions in a text file with \'CREATE OR REPLACE FUNCTION somefunction\'. So if I add or change some function I just feed the file to psql.

相关标签:
7条回答
  • 2020-12-01 02:41

    As of Postgres 10 you can drop functions by name only, as long as the names are unique to their schema. Just place the following declaration at the top of your function file:

    drop function if exists my_func;
    

    Documentation here.

    0 讨论(0)
提交回复
热议问题