Search Postgresql Archives

Re: Difference between varchar and text?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2012-11-05, Moshe Jacobson <moshe@xxxxxxxxxxxx> wrote:
> --14dae93404f5f865d804cdc59353
> Content-Type: text/plain; charset=ISO-8859-1
>
> Is there any practical difference between defining a column as a
> varchar(n)vs. a varchar
> vs. a text field?
>
> I've always been under the impression that if I am wanting to index a
> varchar column, it is better to set a maximum length. 

It doesn't really matter, the index itself will impose the limit
(unless you use a hash index where ther is no limit)

> But more importantly, what's the practical difference between varchar with
> no limit and text?

text is immeasurably faster.

> Thanks, and apologies if this is a FAQ...



-- 
⚂⚃ 100% natural



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux