1CREATE FUNCTION function_name(argument1 type,argument2 type)
2 RETURNS type AS
3BEGIN
4 staments;
5END;
6LANGUAGE 'language_name';
7
1postgres=# Create or replace function fun1(n int) returns int
2
3as
4
5$$
6
7Begin
8
9Insert into test values (n,'2019-11-26');
10
11Return 1;
12
13End;
14
15$$
16
17Language 'plpgsql';
18
19CREATE FUNCTION
20
21postgres=#