pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
varchar vs text columns
4+ messages / 4 participants
[nested] [flat]

* varchar vs text columns
@ 2007-07-23 18:33  Jessica Richard <rjessil@yahoo.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Jessica Richard @ 2007-07-23 18:33 UTC (permalink / raw)
  To: pgsql-admin

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?

Thanks.

       
---------------------------------
Park yourself in front of a world of choices in alternative vehicles.
Visit the Yahoo! Auto Green Center.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: varchar vs text columns
@ 2007-07-23 19:11  Andrew Sullivan <ajs@crankycanuck.ca>
  parent: Jessica Richard <rjessil@yahoo.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Andrew Sullivan @ 2007-07-23 19:11 UTC (permalink / raw)
  To: pgsql-admin

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?



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: varchar vs text columns
@ 2007-07-23 19:20  Peter Eisentraut <peter_e@gmx.net>
  parent: Jessica Richard <rjessil@yahoo.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Peter Eisentraut @ 2007-07-23 19:20 UTC (permalink / raw)
  To: pgsql-admin; +Cc: Jessica Richard <rjessil@yahoo.com>

Jessica Richard wrote:
> What is the difference between varchar and text for a string column?

Nothing, if you don't use a limit for varchar.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: varchar vs text columns
@ 2007-07-24 13:16  Lew <lew@lewscanon.nospam>
  parent: Andrew Sullivan <ajs@crankycanuck.ca>
  0 siblings, 0 replies; 4+ messages in thread

From: Lew @ 2007-07-24 13:16 UTC (permalink / raw)
  To: pgsql-admin

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2007-07-24 13:16 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-07-23 18:33 varchar vs text columns Jessica Richard <rjessil@yahoo.com>
2007-07-23 19:11 ` Andrew Sullivan <ajs@crankycanuck.ca>
2007-07-24 13:16   ` Lew <lew@lewscanon.nospam>
2007-07-23 19:20 ` Peter Eisentraut <peter_e@gmx.net>

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