varchar(n) and text

From: Yan Cheng Cheok <yccheok(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: varchar(n) and text
Date: 2010-02-04 01:27:33
Message-ID: 55336.61312.qm@web65707.mail.ac4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

According to http://www.postgresql.org/docs/8.0/interactive/datatype-character.html

I always use TEXT, for column which store text so that I need not to worry on text length.

However, in certain situation, I know that my text length will always < 10 characters

I was wondering, if I using TEXT, will there have any overhead on

(1) storage space?
(2) query performance?
(3) write performance?

Shall I just use varchar(10) ?

Thanks!

Thanks and Regards
Yan Cheng CHEOK

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2010-02-04 01:31:11 Re: varchar(n) and text
Previous Message Sean Hsien 2010-02-04 01:21:46 serial columns with replication/cluster