Added postgres support for aggregated tables