简体   繁体   English

有关存储超过255个字符的文本列的数据库模式的建议

[英]Recommendation on database schema for a text column storing more than 255 characters

I have a database column that will be storing errors/warnings returned from an API - I would usually have a column called 'description' with a varchar(255) but in some (very few cases) this column may need to store a value that is greater than 255 characters (potentially upto 400-500 characters). 我有一个数据库列,该列将存储从API返回的错误/警告-我通常会有一个名为'description'的列,该列带有varchar(255),但在某些情况下(很少),该列可能需要存储一个大于255个字符(可能最多400-500个字符)。

This field won't need any ability to search or anything like that, can anyone suggest the best MySQL data type to use for this instance. 该字段不需要任何搜索功能或类似功能,任何人都可以建议用于此实例的最佳MySQL数据类型。 This will store text and nothing else. 这将存储文本,仅此而已。

I would presume text - but just wondered what everyone else thought. 我会假设文本 -但想知道其他人的想法。

You can use varchar(500) for newer versions. 您可以将varchar(500)用于较新的版本。

What is the MySQL VARCHAR max size? MySQL VARCHAR的最大大小是多少?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM