I was wondering if it were possible (and/or desirable) to create custom types with constraints on the values. Say I have a custom type for height/width/length:
CREATE TYPE dimensions AS (w float, h float, l float);
I'd like to ensure that none of my widths are greater than 10 (for example).
Is such a thing possible, or would I be better served creating check constraints on every table that uses this type? I'd like to be able to add/edit the constraint in a single place (ie, on the type itself).
Thanks!