         $BODY$
         BEGIN
         INSERT INTO coils_realtime_log
-        (record_timestamp,  record_table_name,  record_id,  record_operation,  record_status)
+        (record_timestamp,  record_table_name,  record_id, record_id_type, record_operation,  record_status)
         VALUES
-        ( now(),   TG_TABLE_NAME ,  NEW.id,  'INSERT',  'WAITING');
+        ( now(),   TG_TABLE_NAME ,  NEW.id,
+        (select data_type from information_schema.columns where column_name='id' and table_name = TG_TABLE_NAME),
+        'INSERT',  'WAITING');
         RETURN NULL;
         END;
         $BODY$

        record_timestamp    timestamp without time zone,
        record_table_name   character varying,
        record_id           character varying,
        record_operation    character varying,
        record_status       character varying
        );

        sql-to-create-admin-table "
        CREATE TABLE coils_users
        (
        id character varying NOT NULL,
        user_name character varying,
        CONSTRAINT users_pkey PRIMARY KEY (id)
        );
