Re: Disadvantages to using "text"

From: "Richard Broersma" <richard(dot)broersma(at)gmail(dot)com>
To: "Don Mies (NIM)" <dmies(at)networksinmotion(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Disadvantages to using "text"
Date: 2008-05-07 16:03:57
Message-ID: 396486430805070903w66a41485h3de0e502c6f318de@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, May 7, 2008 at 8:52 AM, Don Mies (NIM)
<dmies(at)networksinmotion(dot)com> wrote:
> Are there any reasons for not using the "text" type whenever a variable
> length string field is needed? Are there penalties in disk usage, memory
> usage or performance?

Some client programs don't know how to deal with this and the
unconstrained VARCHAR datatype. Especially where they are used as
primary/foreign key or as collumns used in grouping aggregates. For
example MS-Access and Crystal reports maps the text data type as a
memo field which has limitations.

> What are the differences between declaring something "varchar" or
> "varchar(n)" or "text"? (I realize that the middle one has an upper limit
> while the others do not.)

Practically, VARCHAR = TEXT. Client programs like VARCHAR(N) as long
as it can map its constained text datatype to it.

--
Regards,
Richard Broersma Jr.

Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2008-05-07 16:06:40 Re: [NOVICE] encoding problems
Previous Message Aurynn Shaw 2008-05-07 16:02:10 Re: Disadvantages to using "text"