如创建一个与函数同名的存储过程会提示function xxx already exists with same argument types。
teledb=# CREATE OR REPLACE FUNCTION proc_1() RETURNS void AS
$$
begin
raise notice 'Hello teledb_pg';
end;
$$
LANGUAGE PLPGSQL;
CREATE FUNCTION
teledb=# CREATE PROCEDURE proc_1() AS
$$
begin
raise notice 'Hello teledb_pg';
end;
$$
LANGUAGE PLPGSQL;
ERROR: function "proc_1" already exists with same argument types
teledb=#
如果要替换,则提示。
teledb=# CREATE OR REPLACE PROCEDURE proc_1() AS
$$
begin
raise notice 'Hello teledb_pg';
end;
$$
LANGUAGE PLPGSQL;
ERROR: cannot change routine kind
DETAIL: "proc_1" is a function.
teledb=#