I am using postgreSQL with pgAdmin 4 and I have created a database function named "fn_test1()". I want to delete this function and before delete this function, I want to create a backup function named "fn_test1_bk()" . Can anyone help me to do this?


ALTER FUNCTION name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] RENAME TO new_name. There is even an example at bottom of page. Kills two birds with one stone.