     if not found then
         logtrg := 'create trigger ' || quote_ident(logtrg_name)
             || ' after insert or update or delete on ' || londiste.quote_fqname(fq_table_name)
-            || ' for each row execute procedure pgq.sqltriga(' || quote_literal(i_queue_name) || ')';
+            || ' for each row execute procedure pgq.sqltriga(' || quote_literal(i_queue_name);
+        if i_trg_args is not null then
+            for i in array_lower(i_trg_args, 1) .. array_upper(i_trg_args, 1) loop
+                logtrg := logtrg || ', ' || quote_literal(i_trg_args[i]);
+            end loop;
+        end if;
+        logtrg := logtrg || ')';
         execute logtrg;
     end if;
 

    logtrg_previous text;
    logtrg text;
    tbl record;
begin
    fq_table_name := londiste.make_fqname(i_table_name);
    col_types := londiste.find_column_types(fq_table_name);

    select 200, 'Table added: ' || fq_table_name into ret_code, ret_note;
    return;
end;
$$ language plpgsql;

create or replace function londiste.local_add_table(
    in i_queue_name     text,
    in i_table_name     text,
    out ret_code        int4,
    out ret_note        text)
as $$
-- ----------------------------------------------------------------------
-- Function: londiste.local_add_table(2)
--
--      Register table on Londiste node.
--
-- Returns:
--      200 - Ok
--      301 - Warning, trigger exists that will fire before londiste one
--      400 - No such set
-- ----------------------------------------------------------------------
begin
    select f.ret_code, f.ret_note into ret_code, ret_note
      from londiste.local_add_table(i_queue_name, i_table_name, null) f;
    return;
end;
$$ language plpgsql strict;


