postgeSQL datatype Text question
Posted: Fri Sep 17, 2004 1:28 pm
If i have a
column A with type VARCHAR(10);
and
column B with type TEXT;
I then insert "ABCDEFGHIJ", which is a string of length 10. Would it take up more space in DB when inserted into column B compared to column A?
I always have the idea that TEXT datatype takes up more reserve space (before any thing is inserted) in PostgreSQL and thus always went for VARCHAR. Unfortunately most of the time, i cannot control the length of the string that is coming into the database.
Please explain. Even if i am right, please say so because i am confused.
Regards
Mian
column A with type VARCHAR(10);
and
column B with type TEXT;
I then insert "ABCDEFGHIJ", which is a string of length 10. Would it take up more space in DB when inserted into column B compared to column A?
I always have the idea that TEXT datatype takes up more reserve space (before any thing is inserted) in PostgreSQL and thus always went for VARCHAR. Unfortunately most of the time, i cannot control the length of the string that is coming into the database.
Please explain. Even if i am right, please say so because i am confused.
Regards
Mian