DROP TABLE stats_iptables; DROP SEQUENCE stats_iptables_stat_id_seq; CREATE TABLE stats_iptables ( stat_id serial primary key, date timestamp, hash varchar, inbound varchar, host varchar, chain varchar, outbound varchar, mac varchar, src varchar, dst varchar, len integer, tos varchar, prec varchar, ttl integer, id integer, proto varchar, spt integer, dpt integer, seq varchar, ack varchar, window varchar, res varchar, rst varchar, urgp varchar ); create index hash_idx on stats_iptables (hash); create index date_idx on stats_iptables (date); grant select on stats_iptables to apache; grant insert on stats_iptables to apache; grant update on stats_iptables to apache; grant delete on stats_iptables to apache; grant update on stats_iptables_stat_id_seq to apache;