title: Test datatype on postgresql update trigger
body: <p>I use a Trigger to detect if at least one value has changed when an update is performed on a table.</p>
  
  <p>The function :</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION update_version_column()
    RETURNS trigger AS
  $BODY$
  BEGIN
      IF row(NEW.*) IS DISTINCT FROM row(OLD.*) THEN
          NEW.version = now(); 
          RETURN NEW;
      ELSE
          RETURN OLD;
      END IF;
  END;
  $BODY$
    LANGUAGE plpgsql VOLATILE
    COST 100;
  ALTER FUNCTION update_version_column()
    OWNER TO gamesplateform;
  </code></pre>
  
  <p>The problem is, when a column type is "json", the "is distinct" failed (standard comportement, explained in the documentation).</p>
  
  <p>I search a way to perform the same thing, but if a column is in "json" type, I want to force the "jsonb" cast which accept comparison operator.</p>
  
  <p>Is there a way to do this ?</p>
  
  <p>Thanks !</p>