Alter Function Examples

PostreSQL tutorial – Alter function

Alter postgresql function

Syntax

ALTER FUNCTION function_name 
( [ [ argmode ] [ argname ] argtype [, ...] ] ) 
RENAME TO new_function_name;

ALTER FUNCTION function_name 
( [ [ argmode ] [ argname ] argtype [, ...] ] ) 
OWNER TO new_owner;

ALTER FUNCTION function_name 
( [ [ argmode ] [ argname ] argtype [, ...] ] ) 
SET SCHEMA new_schema;

Example

ALTER FUNCTION set_customers
(p_first_name varchar, p_last_name varchar) 
RENAME TO add_customers;

ALTER FUNCTION set_customers
(p_first_name varchar, p_last_name varchar) 
OWNER TO user_1;

ALTER FUNCTION set_customers
(p_first_name varchar, p_last_name varchar) 
SET SCHEMA test_schema;

Create Function |
Drop Function