Using Custom Type In Postgres Functions