Well, I would guess that whoever designed the DB structure was used to
non-Postgres databases. First see

http://www.postgresql.org/docs/8.3/static/datatype-character.html

for the tip in Para. 7 on that page. 

Most Data Bases DO require much more effort (i.e. don't run as fast)
if you use unlimited size data fields but Postgres is different.

If either an old version of Postgres was the target for the original
design or the designer had not read the above item then the result is
varchar(nn) being used where for a pure Postgres system a TEXT (or varchar)
field is a better design.


----- Original Message -----
From: "Rob Richardson" <[EMAIL PROTECTED]>
To: pgsql-general@postgresql.org
Sent: Tuesday, October 21, 2008 8:07:31 AM GMT -05:00 US/Canada Eastern
Subject: [GENERAL] Varchar vs varchar(64)


Greetings! 

The database we install at our customers as part of our product includes an 
event_history table. For some reason lost in the mists of time, the most 
important field in that table, the description, is a varchar field specified to 
be only 64 characters long. This leads me to a more fundamental question: why 
specify the length of a varchar field at all? Is there a big difference between 
the amount of disk space taken up by "abc" stored in a varchar(64) field and 
stored in a varchar field? How much space does an unspecified-length varchar 
field take up? Are there other reasons to use varchar(64) instead of varchar? 

Thank you very much! 

RobR 


-- 
This email, and any files transmitted with it, is confidential 
and intended solely for the use of the individual or entity to 
whom they are addressed.  If you have received this email in error, 
please advise [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>.

New MDT Software Headquarters (As of July 1, 2008):
3480 Preston Ridge Road
Suite 450
Alpharetta, GA 30005


Philip W. Dalrymple III <[EMAIL PROTECTED]>
MDT Software - The Change Management Company
+1 678 297 1001
Fax +1 678 297 1003


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to