Re: Varchar vs varchar(64)

Поиск
Список
Период
Сортировка
От Philip W. Dalrymple
Тема Re: Varchar vs varchar(64)
Дата
Msg-id 4711937.77261224594686126.JavaMail.root@is-mail-2.mdtsoft.com
обсуждение исходный текст
Ответ на Varchar vs varchar(64)  ("Rob Richardson" <Rob.Richardson@rad-con.com>)
Список pgsql-general
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" <Rob.Richardson@rad-con.com>
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
inthe mists of time, the most important field in that table, the description, is a varchar field specified to be only
64characters long. This leads me to a more fundamental question: why specify the length of a varchar field at all? Is
therea big difference between the amount of disk space taken up by "abc" stored in a varchar(64) field and stored in a
varcharfield? 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 postmaster@mdtsoft.com <mailto:postmaster@mdtsoft.com>.

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


Philip W. Dalrymple III <pwd@mdtsoft.com>
MDT Software - The Change Management Company
+1 678 297 1001
Fax +1 678 297 1003


В списке pgsql-general по дате отправления:

Предыдущее
От: "Philip W. Dalrymple"
Дата:
Сообщение: Re: Session variables (how do I pass session data to a function)
Следующее
От: Devrim GÜNDÜZ
Дата:
Сообщение: Re: How to free disk space