ERROR: column "FLAT" does not exit. Line 1. SELECT UPPER(FLAT). Kindly fix the trigger CREATE OR REPLACE FUNCTION trigger_fct_tri_sv_tab_temp() 
RETURNS trigger 
AS 
$BODY$
BEGIN
  n.FLAT := UPPER(n.FLAT);
  RETURN NEW;
end
$BODY$
 LANGUAGE plpgsql
 SECURITY DEFINER;


CREATE TRIGGER tri_sv_tab_temp
    BEFORE INSERT OR UPDATE ON sv_tab_temp FOR EACH ROW
EXECUTE PROCEDURE trigger_fct_tri_sv_tab_temp();
The updated or inserted row is referenced using the new record:
CREATE OR REPLACE FUNCTION trigger_fct_tri_sv_tab_temp() 
RETURNS trigger 
AS 
$BODY$
BEGIN
  new.FLAT := UPPER(new.FLAT);
  RETURN NEW;
end
$BODY$
 LANGUAGE plpgsql
 SECURITY DEFINER;