how to prevent UPDATE of existing rows/record but allow INSERT using PostgreSQL trigger?
You can use GRANT &amp; REVOKE for this purpose:

 CREATE TABLE TEST (ID int, NAME text);

 REVOKE ALL ON TABLE TEST FROM CURRENT_USER;

 GRANT INSERT ON TABLE TEST TO CURRENT_USER;
 GRANT SELECT ON TABLE TEST TO CURRENT_USER;




 INSERT INTO TEST VALUES (1, 'NAME 1'),(2, 'NAME 2');




UPDATE TEST SET NAME='NAME 3' WHERE ID = 1;
ERROR:  permission denied for table test


db&lt;>fiddle here