remove adhoc fields from pgsql grouping
update unit tests