pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
(no subject)
2+ messages / 2 participants
[nested] [flat]

* (no subject)
@ 2003-02-11 11:10 jeandre@itvs.co.za
  2003-02-11 13:29 ` Re: Andrew Sullivan <andrew@libertyrms.info>
  0 siblings, 1 reply; 2+ messages in thread

From: jeandre@itvs.co.za @ 2003-02-11 11:10 UTC (permalink / raw)
  To: pgsql-performance

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?

Many Thanks
Jeandre




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

* Re:
  2003-02-11 11:10 (no subject) jeandre@itvs.co.za
@ 2003-02-11 13:29 ` Andrew Sullivan <andrew@libertyrms.info>
  0 siblings, 0 replies; 2+ messages in thread

From: Andrew Sullivan @ 2003-02-11 13:29 UTC (permalink / raw)
  To: pgsql-performance

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




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


end of thread, other threads:[~2003-02-11 13:29 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-11 11:10  jeandre@itvs.co.za
2003-02-11 13:29 ` Re: Andrew Sullivan <andrew@libertyrms.info>

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