creation of views and enum functions for postgres