title: record "new" has no field .. postgres
body: <p>I have following tables:</p>
  
  <pre><code>CREATE TABLE public.fv
  (
    producer text NOT NULL,
    version text NOT NULL,
    CONSTRAINT fv_pkey PRIMARY KEY (producer, version)
  )
  
  CREATE TABLE public.fv_parameters
  (
    name text NOT NULL,
    CONSTRAINT f_parameters_pkey PRIMARY KEY (name)
  )
  </code></pre>
  
  <p>I would like to update automatically <code>fv_parameters</code> when I insert something into <code>fv</code>. So I created a trigger like:</p>
  
  <pre><code>CREATE TRIGGER insert_to_subtables
    AFTER INSERT OR UPDATE
    ON public.fv
    FOR EACH ROW
    EXECUTE PROCEDURE public.insert_to_subtables();
  CREATE OR REPLACE FUNCTION public.insert_to_subtables()
    RETURNS trigger AS
  $BODY$
      BEGIN
      INSERT INTO parameters values(NEW.producer || '_' || NEW.version,'producer');
      END;
  $BODY$
    LANGUAGE plpgsql VOLATILE
    COST 100;
  ALTER FUNCTION public.insert_to_subtables()
    OWNER TO "PUBLIC";
  </code></pre>
  
  <p>However, it keeps giving me error:</p>
  
  <pre><code>ERROR:  record "new" has no field "producer"
  CONTEXT:  SQL statement "INSERT INTO parameters values(NEW.producer || '_' || NEW.version,'producer')"
  </code></pre>
  
  <p>I dont understand what I am doing wrong? Clearly my table <code>fv</code> HAS a field named <code>producer</code>, and I am inserting a new row to it, so it must contain a <code>producer</code> field?.. Any help please</p>
  
  <p><strong>EDIT</strong> Solved, but still not sure how, I just deleted all triggers (I had only 2 of them, but named equally, in different tables), and declared them again. Now it works</p>