Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Difference between char and varchar



Bruno Wolff III a écrit :
On Mon, Aug 28, 2006 at 15:04:26 -0400,
  Richmond Dyes <rdyes(at)monroehosp(dot)org> wrote:
I know the difference between char and varchar is char is fixed length and varchar returns variable length. Which one should be used and why?

You normally want to use 'text' instead of either 'char' or 'varchar'.
Unless there is a business rule limiting the length of a string (and sometimes
not even then) you want to use 'text' as it is more flexible.
But it is not 'standard' sql, so it won't be portable to other databases, if needed.



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group