How to check in a trigger if the entire row remains the same after an update? Of course i could do it for every column comparing like this:

if (old.column1 = new.column1 and old.column2 = new.column2...)


But it would b hard coded and hard to maintain if I add another column in the future, for example.

Is there a way to check if all the columns remain the same without checking every individual columns manually?
You can simply compare the old and the new records using is not distinct from which handles NULL values correctly (if all columns are defined as NOT NULL you can simply use = or &lt;&gt;)

if old is not distinct from new then 
   .... do something
end if;


The same can be done to check if at least one column changed:

if old is distinct from new then 
   .... do something
end if;