There is no performance difference among these three types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance advantages in some other database systems, there is no such advantage in PostgreSQL; in fact character(n) is usually the slowest of the three because of its additional storage costs. In most situations text or character varying should be used instead.
这个不需要指定长度的类型更被推荐使用。
我平时创建的表,大部分字段其实都是字符串类型,不用思考这个字段有多长,这不是一件非常方便的事情吗?为什么新项目选型的时候,大家还要用 mysql 呢
postgresql, character, Text, MySQL