Creating validated data types in Postgres