r/SQL • u/donewitheverything26 • 6h ago
Discussion where do you actually write down what a column means
Inherited a schema where roughly half the columns are self-explanatory and the rest are things like flag_3 and val_b. Person who built it left. There's a Confluence page describing six columns, last edited before most of them existed.
I've been using COMMENT ON COLUMN because it lives with the database and can't drift into a stale wiki. Downside is nobody looks at it, it doesn't show up anywhere people work, and I've no way to know if a comment is still true after a migration.
Things I'm unsure about:
does anyone actually keep COMMENT ON up to date at scale, or does it rot the same as the wiki just less visibly
if a column's meaning changes but the name doesn't, is there anything that catches that, or is it purely a review discipline problem
and for the columns nobody can explain at all, do you leave them, drop them, or keep them with a comment saying unknown
I've been profiling the values to guess — cardinality, null rate, distributions — which narrows it but never gets me to what the thing means.