Re: varchar

From: Alexander Staubo <alex(at)purefiction(dot)net>
To: Alain Roger <raf(dot)news(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: varchar
Date: 2006-11-05 14:38:03
Message-ID: 14EB2692-14C7-4D9F-956E-5FF172A41F20@purefiction.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Nov 5, 2006, at 15:32 , Alain Roger wrote:

> I would like to allow web site user to fill a field and for that i
> would need a large varchar()...maybe something around 100.000
> characters.
> i guess that VARCHAR can not hold so many character and that i
> should turn to bytea.
> Am I right or is there some other possibility ?

Not at all -- PostgreSQL can fit roughly 1 gigabyte of data in a
single varchar column. Avoid bytea for anything except purely binary
data. Keep in mind that PostgreSQL is not able to index values longer
than ~ 8 kilobytes.

Note that the "text" data type, which is unlimited in length by
definition, is usually preferred over varchar. Read more here:

http://www.postgresql.org/docs/8.1/interactive/datatype-
character.html

Alexander.

In response to

  • varchar at 2006-11-05 14:32:18 from Alain Roger

Browse pgsql-general by date

  From Date Subject
Next Message novnov 2006-11-05 16:51:52 Re: Simple stored procedure examples?
Previous Message Mark Morgan Lloyd 2006-11-05 14:34:19 Re: Converting a timestamp to a time