pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <andrew@libertyrms.info>
To: pgsql-performance@postgresql.org
Subject: Re:
Date: Tue, 11 Feb 2003 08:29:27 -0500
Message-ID: <20030211082927.C15541@mail.libertyrms.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0302111304390.3450-100000@localhost.localdomain>
References: <Pine.LNX.4.44.0302111304390.3450-100000@localhost.localdomain>

On Tue, Feb 11, 2003 at 01:10:12PM +0200, jeandre@itvs.co.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@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110




view thread (2+ messages)

Message-ID: <20030211082927.C15541@mail.libertyrms.com>
Permalink:  ../20030211082927.C15541@mail.libertyrms.com/
Also on:    postgresql.org/message-id/20030211082927.C15541@mail.libertyrms.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: andrew@libertyrms.info
  Subject: Re: 
  In-Reply-To: <20030211082927.C15541@mail.libertyrms.com>
  References: <Pine.LNX.4.44.0302111304390.3450-100000@localhost.localdomain> <20030211082927.C15541@mail.libertyrms.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