postgres stable function to check column for column entries code example
Example: create function in postgresql
create [or replace] function function_name(param_list)
returns return_type
language plpgsql
as $$
declare
-- variable declaration
begin
-- logic
end;
$$