If I have this in a migration:
t.text :body
How much text can I fit in :body
? (I'm using PostgreSQL if that's relevant)
Difference Between PostgreSQL TEXT and VARCHAR Data Types The only difference between TEXT and VARCHAR(n) is that you can limit the maximum length of a VARCHAR column, for example, VARCHAR(255) does not allow inserting a string more than 255 characters long.
As you are probably aware, both string and text save “string-type” information that you can freely write in. The difference between the two is how many characters you can put in these fields. A string field has a limit of 255 characters, whereas a text field has a character limit of 30,000 characters.
3) PostgreSQL Text Data Type The PostgreSQL Text data type is used to keep the character of infinite length. And it can hold a string with a maximum length of 65,535 bytes.
straight from PostgreSQL Documentation
text variable unlimited length
Meaning you can put any length of string in a text column when using PostgreSQL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With