Postgres View Function Mapping