Creating Function In Postgresql