Re: when to use char, varchar or text

From: "Joshua b(dot) Jore" <josh(at)greentechnologist(dot)org>
To: Rory Campbell-Lange <rory(at)campbell-lange(dot)net>
Cc: Postgresql Novice List <pgsql-novice(at)postgresql(dot)org>
Subject: Re: when to use char, varchar or text
Date: 2002-05-23 12:35:48
Message-ID: Pine.BSO.4.44.0205230731500.29256-100000@kitten.greentechnologist.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I'm not sure what you are implementing but as I recall any single address
may be longer than 200 characters. That may not be terribly likely in
practice but it is allowed and your mail program would be expected to
allow it. I also wonder whether you mean to concatenate the addresses via
', ' or how you are going to store multiple To, CC, etc recipients.

The nature of where you are working advocates for the text datatype.

Joshua b. Jore
http://www.greentechnologist.org

On Thu, 23 May 2002, Rory Campbell-Lange wrote:

> I'm making a table to hold a queue of incoming and outgoing email
> messages. I'm confused about using char, varchar or text fields - I
> imagine they are searchable (without and index) with decreasing speed
> from char to text. Is that right?
>
> The (very simplified) column setup I have includes:
> to varchar(200)
> from varchar(200)
> cc varchar(200)
> subject text
> body text
>
> Should I make the columns all of type text so that large numbers of 'to'
> recipients can be supported?
>
> Some general advice greatly appreciated.
>
> p.s. I expect the number of rows in this table to be less than 5000.
>
> --
> Rory Campbell-Lange
> <rory(at)campbell-lange(dot)net>
> <www.campbell-lange.net>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Rory Campbell-Lange 2002-05-23 13:02:51 auto update dates
Previous Message Andrew McMillan 2002-05-23 12:34:45 Re: SELECT DISTINCT