Re:

From: Andrew Sullivan <andrew(at)libertyrms(dot)info>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re:
Date: 2003-02-11 13:29:27
Message-ID: 20030211082927.C15541@mail.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Feb 11, 2003 at 01:10:12PM +0200, jeandre(at)itvs(dot)co(dot)za wrote:
> When defining data types, which is better text, varchar or char? I heard
> that on Postgres text is better, but I know on Sybase char is more efficient.
> Can someone please tell me whether this statement is true and if so why?

Avoid char(n) unless you absolutely know you have a constant-length
field. Even then, you may get surprises.

For practical purposes, text is probably your best bet. For
compatibility, there is varchar(), which is the same thing as text.
If you need to limit the size, use varchar(n). Be aware that it is
slightly slower, so don't use it unless your model demands it.

A

--
----
Andrew Sullivan 204-4141 Yonge Street
Liberty RMS Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info> M2P 2A8
+1 416 646 3304 x110

In response to

  • at 2003-02-11 11:10:12 from jeandre

Browse pgsql-performance by date

  From Date Subject
Next Message Merlin Moncure 2003-02-11 15:44:07 Re: [HACKERS] PostgreSQL Benchmarks
Previous Message jeandre 2003-02-11 11:10:12