varchar(n) - how big should n be?

patarapolw

Pacharapol Withayasakpunt

Posted on November 12, 2020

varchar(n) - how big should n be?

I am mostly worried about whether I made it too small, and whether I can resize it.

For some reasons, the ORM requires specifying size, even if the underlying JDBC driver doesn't need to be strict about size (H2), or doesn't read size at all (SQLite). I am also planning to use PostgreSQL as well.

According to StackOverflow, maybe even VARCHAR(2) poses no restriction in size?

Also, there seems to be no meaning in using 2^n - 1?

💖 💪 🙅 🚩
patarapolw
Pacharapol Withayasakpunt

Posted on November 12, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related