title: column "i" does not exist
body: <p>I was created a trigger on my table.When insert/update/delete its adds a key i,u,d like that.
  And i'm trying to insert this keys on another table but gives me error like that:</p>
  
  <pre><code>    ERROR:  column "i" does not exist
      LINE 1: ...(operation,stamp,userid,empname,salary) VALUES('||i||', now(...
                                                                   ^
      QUERY:  SELECT dblink_exec('INSERT INTO emp_audit(operation,stamp,userid,empname,salary) VALUES('||i||', now(), user,NEW.*)')
      CONTEXT:  PL/pgSQL function process_emp_audit() line 14 at PERFORM
  
  
      ********** Error **********
  
      ERROR: column "i" does not exist
      SQL state: 42703
      Context: PL/pgSQL function process_emp_audit() line 14 at PERFORM
  </code></pre>
  
  <p>i don't know why it's give me this error.And this is my trigger function</p>
  
  <pre><code>-- Function: process_emp_audit()
  
  -- DROP FUNCTION process_emp_audit();
  
  CREATE OR REPLACE FUNCTION process_emp_audit()
    RETURNS trigger AS
  $BODY$
      BEGIN
      PERFORM dblink_connect('dbname=ekders port=5432 user=****** password=*****');
  
          IF (TG_OP = 'DELETE') THEN
          PERFORM dblink_exec('INSERT INTO emp_audit "D", now(), user, OLD.*;');
          PERFORM dblink_disconnect();
          RETURN OLD;
          ELSIF (TG_OP = 'UPDATE') THEN
          PERFORM dblink_exec('INSERT INTO emp_audit "U", now(), user, NEW.*;');
          PERFORM dblink_disconnect();
          RETURN NEW;
          ELSIF (TG_OP = 'INSERT') THEN
          PERFORM dblink_exec('INSERT INTO emp_audit(operation,stamp,userid,empname,salary) VALUES('||i||', now(), user,NEW.*)');
          PERFORM dblink_disconnect();
              RETURN NEW;
          END IF;
          RETURN NULL; -- result is ignored since this is an AFTER trigger
      END;
  $BODY$
    LANGUAGE plpgsql VOLATILE
    COST 100;
  ALTER FUNCTION process_emp_audit()
    OWNER TO postgres;
  </code></pre>