pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lew <lew@lewscanon.nospam>
To: pgsql-admin@postgresql.org
Subject: Re: varchar vs text columns
Date: Tue, 24 Jul 2007 09:16:49 -0400
Message-ID: <ZbCdnTkmkddcZjjbnZ2dnUVZ_gudnZ2d@comcast.com> (raw)
In-Reply-To: <20070723191115.GI9196@phlogiston.dyndns.org>
References: <835361.84815.qm@web56408.mail.re3.yahoo.com>
	<20070723191115.GI9196@phlogiston.dyndns.org>

Andrew Sullivan wrote:
> On Mon, Jul 23, 2007 at 11:33:54AM -0700, Jessica Richard wrote:
>> What is the difference between varchar and text for a string column?
>> What is the benefit of using each one?
>> Is text better than varchar performance wise?
> 
> From the manual:
> 
> 	Tip:  There are no performance differences between these
> 	three types, apart from the increased storage size when using
> 	the blank-padded type. While character(n) has performance
> 	advantages in some other database systems, it has no such
> 	advantages in PostgreSQL. In most situations text or
> 	character varying should be used instead.
> 
> Note that varchar(n) will have a performance effect, because on
> insert or update you have to check to make sure the input doesn't
> exceed the specified length.  

See also Peter Koczan's reply in the '"_" in a serach  pattern' thread.

-- 
Lew



view thread (4+ messages)

Message-ID: <ZbCdnTkmkddcZjjbnZ2dnUVZ_gudnZ2d@comcast.com>
Permalink:  ../ZbCdnTkmkddcZjjbnZ2dnUVZ_gudnZ2d@comcast.com/
Also on:    postgresql.org/message-id/ZbCdnTkmkddcZjjbnZ2dnUVZ_gudnZ2d@comcast.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: lew@lewscanon.nospam
  Subject: Re: varchar vs text columns
  In-Reply-To: <ZbCdnTkmkddcZjjbnZ2dnUVZ_gudnZ2d@comcast.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox