DEV Community

Discussion on: varchar(n) - how big should n be?

Collapse
 
dmfay profile image
Dian Fay

I wrote about this recently! There's no hard and fast rule -- the problem with erring on the small side is obvious, but if it's too big you waste space which has further effects on how hard the database server has to work. And of course actual values for 'too big' and 'too small' depend entirely on the column itself.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

So, there is TEXT type in Postgres (and obviously SQLite), with not only no size limit, but also better performance as well!