title: Cannot insert new row into view using trigger function
body: <p>I'm currently inserting this data <code>{"curr": "testcurr","nm": "testnm"}</code>
  to a view. </p>
  
  <p>A trigger function is then run to insert into the original tables instead.</p>
  
  <p>I'm getting an error <code>cannot insert into column "curr" of view "tblview"</code> from the trigger function.</p>
  
  <p>Here is the part of my code:</p>
  
  <pre><code>IF (tg_op = 'INSERT') THEN
                  NEW."dat"= jsonb_build_object("curr",NEW.'curr','symb',NEW."symb");
                  NEW."ct"=now();
                  INSERT INTO data.tbl
                      (
                      "nm",
                      "dat",
                      "ct",
                      )
                      VALUES
                      (
                      NEW."nm",
                      NEW."dat"
                      NEW."ct"
                      )returning "id" into NEW.id;
  END
  </code></pre>
  
  <p>Here is my view:</p>
  
  <pre><code>CREATE OR REPLACE VIEW data.tblview AS
   SELECT gn.id,
      gn.nm,
      ((gn.dat -&gt;&gt; 'curr'::text))::character varying(64) AS curr,
      ((gn.dat -&gt;&gt; 'symb'::text))::character varying(64) AS symb,
      gn.ct
     FROM data.gn
  </code></pre>
  
  <p>So what is the reason why I can't insert a new row?</p>