Grant Fritchey dives into functionality:
I’m sure I’m not alone when I say, sometimes I get sidetracked. In this particular instance, I hadn’t intended to start learning about User-Defined Types (UDT) in PostgreSQL – I just wanted to test a behavior that involved creating a UDT. But, once I started reading, I was hooked. I mean, four distinct UDTs with different behaviors? That’s pretty cool. Let’s get into it.
Read on to learn more about why there are so many user-defined types in Postgres. Looking at the list, I do really like what they have available. You can, of course, replicate the functionality otherwise (e.g., check constraints on a regular column for DOMAIN, foreign key link to a lookup table for ENUM), but it’s nice to have those types right there for clarity of design and so you don’t accidentally forget to apply an appropriate constraint.