Re: [PERFORMANCE] Beetwen text and varchar field

From: "Steinar H(dot) Gunderson" <sgunderson(at)bigfoot(dot)com>
To: TNO <tnodev(at)free(dot)fr>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: [PERFORMANCE] Beetwen text and varchar field
Date: 2006-01-09 11:49:40
Message-ID: 20060109114940.GB28748@uio.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Jan 09, 2006 at 11:58:19AM +0100, TNO wrote:
> what is the best for a char field with less than 1000 characters?
> a text field or a varchar(1000)

They will be equivalent. text and varchar are the same type internally -- the
only differences are that varchar can have a length (but does not need one),
and that some casts are only defined for text.

If there's really a natural thousand-character limit to the data in question,
use varchar(1000); if not, use text or varchar, whatever you'd like.

/* Steinar */
--
Homepage: http://www.sesse.net/

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alessandro Baretta 2006-01-09 13:51:27 500x speed-down: Wrong query plan?
Previous Message TNO 2006-01-09 10:58:19 [PERFORMANCE] Beetwen text and varchar field