Removed duplicate type resolution code into a new function
Merge branch 'within_group' of https://github.com/davidfetter/postgresql_projects into within_group