Great! You already know the tables and all the attributes we have for about discussion topics, registered users, and their posts.
Remember: In PostgreSQL, it's possible to write a function that does not return anything.
If a function is not supposed to return a value, you should specify
void as its return type. Such functions usually modify the database: they insert or delete rows in table, or they update data stored in tables.
The example below shows how to create a new function that inserts a new event into the
CREATE FUNCTION add_event(id smallint, name varchar(60), city varchar(60))
RETURNS void AS $$
INSERT INTO event
(id, name, city, created_date)
(id, name, city, current_date);
$$ LANGUAGE plpgsql;
The function inserts a row into the
event table based on the values passed as arguments and the current date.