postgresql create function example
Example 1: create function in postgresql
create [or replace] function function_name(param_list)
returns return_type
language plpgsql
as $$
declare
begin
end;
$$
Example 2: plpgsql create function
CREATE FUNCTION function_name(argument1 type,argument2 type)
RETURNS type AS
BEGIN
staments;
END;
LANGUAGE 'language_name';
Example 3: plpgsql create function
postgres=
as
$$
Begin
Insert into test values (n,'2019-11-26');
Return 1;
End;
$$
Language 'plpgsql';
CREATE FUNCTION
postgres=