Re:Documenting your PostgreSQL database
by SugarfreeSA on Monday July 27, 2015 @06:42AM
(#9954388)
Yes, I definitely see value of comments in a situation like flex fields because that's something that may not be straight forward or clearly apparent!
Legacy tables or fields also make sense because the code will remain the same and thus lead to no comment rot.
As long as the comments stay relevant and cause no extra confusion, then it is useful! I suppose it is also situation dependant as well as the preference of the development team at the time.
Similarly, if a table or a field has become "legacy", that is, no longer actively used but kept around because there's old data in it somewhere, that should be commented, too. Or, if a column has it's datatype changed for some reason while there is data in the table, that should probably be noted, too (e.g. char --> varchar, int-->string, etc).
Schema versioning is a huge problem at many companies, especially non-tech companies where the developers are completely at the mercy of their "business stakeholders", and since full-fledged data dictionaries don't exist for almost anything, using simple comments like this could be a boon. I dunno, ymmv, but I'd have appreciated it.