> I'm thinking of using the "COMMENT" of columns when
> creating tables to store some metadata about the
> column, for instance: valid_range of numbers,
> validation regexp, etc.
> I did some tests with including this information as
> then be easily decoded into an actual data structure
> for the scripting language (Python in my case) being
> used. The setup seems to work well.
> One shortcoming is that the maximum size of a COMMENT
> is 256 characters.
> Do you have any comments about this approach?
> What could possibly go very bad about relying on
> this usage of the COMMENT?
Yes, in different storage engines, different stuff is returned.
For example, in InnoDB, what you get returned from
SHOW FULL COLUMNS is not what you stored in the
In short, I would say that the use of COMMENT isn't what
it actually does.
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Database development questions? Check the forum!