I am creating a table on PostgreSQL I know that the file is a char data type but despite I know that it will store maximum 100 chars I would like to know the next:
What are the advantages of a character or character varying instead of text?
What I think I know
If I am not wrong character is fixed length reserved in memory, and varchar is variable, the same as Text data type. This last is able to store at 1 GB of data but with a minimum of 0 kb, the same minimum as the varchar and char.
Hypothetical case
Then, guess that I am very lazy and despite I know that maximum I will store 100 chars I use text because it is able to store this 100chars and more if in the future is needed. What characteristics I am losing here to not use the appropriate data type?
There is no significant difference between VARCHAR and TEXT:
PostgreSQL: Difference between text and varchar (character varying)
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