Q:

create function in postgresql

create [or replace] function function_name(param_list)
   returns return_type 
   language plpgsql
as $$
declare 
-- variable declaration
begin
 -- logic
end;
$$
3
postgres=# Create or replace function fun1(n int) returns int 

as

$$

Begin

Insert into test values (n,'2019-11-26');

Return 1;

End;

$$

Language 'plpgsql';

CREATE FUNCTION

postgres=# 
0

New to Communities?

Join the community