Greg, > Anyone have a good pre-built user-defined type definition for creating / > maintaining / manipulating a SSN ... where valid chars are in the range > 000-00-0000 through 999-99-9999.
Actually, the range is more narrowly defined than that. I'm not sure of the exact rules, but you will never see a leading 0 or a -00- in an SSN. > I imagine that the storage column is probably varchar(11) -- I am looking > for a type definition that Use DOMAINs, not a custom type. It's less work. > Either that or the question is: How can I coerce postgreSQL into using an > input / output "mask"... After you've created your DOMAIN, based on the TEXT type, you can overload the input and output functions to format correctly. Beware, though: input & output functions pretty much have to be written in C. -- Josh Berkus Aglio Database Solutions San Francisco ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend