Page 1 of 1

postgeSQL datatype Text question

Posted: Fri Sep 17, 2004 1:28 pm
by myleow
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

Posted: Fri Sep 17, 2004 1:43 pm
by feyd
why not check the size of the database/table with it yourself and find out definitively?

Posted: Fri Sep 17, 2004 3:26 pm
by myleow
HOw do you do that?

Posted: Fri Sep 17, 2004 3:50 pm
by myleow
anyone know how to check the size of the table/database in PostgreSQL please instruct me, please.

Regards
Mian

Posted: Fri Sep 17, 2004 4:34 pm
by feyd