I came across a question about a data type for MD5 values. The recommendation in that question states using uuid
as type for that field.
The argumentation is solid. But I find that this might be confusing to someone unaware of the points revealed in the above question. The decision to use uuid
as MD5 type is something that I would like to see in some form of documentation in any project that does this.
As a "helper" to whoever looks into the DB Schema, one could argue to create a md5
domain inheriting from uuid
. That way, the column types would be much more explicit and the intention would be much clearer.
But it would use a domain for no other reason than to "rename" an existing type.
It's still something that would make sense to document properly. But that documentation could be centralised to a section explaining the domains in the DB. So you wouldn't gain anything in terms of documentation. The advantage I see is, as mentioned, that the intention becomes clear when looking at the table DDL.
Are there any downsides to this?
varchar(10)
can not be changed tovarchar(20)
if it's used.