title: Update all column in a table using a record
body: <p>I have two identical tables: table1 and table2. I need to replicate all updates from one table to another using an after trigger. But I don't want to list all columns names in the update statement(except the PK). Is it possible to do something like this?</p>
  <pre><code>CREATE FUNCTION replicate_changes()
  RETURNS trigger
  LANGUAGE 'plpgsql' AS
  $BODY$
  BEGIN
  
    UPDATE table2
    SET (*) = NEW.*;
    WHERE table2.id = NEW.id;
   
  
  
    RETURN NULL;
  
  END;
  $BODY$;
  
  CREATE TRIGGER trigger_replicate_changes
      AFTER UPDATE
      ON table1
      FOR EACH ROW
      EXECUTE FUNCTION replicate_changes();
  
  </code></pre>