Re: when to use char, varchar or text - Mailing list pgsql-novice

From Joshua b. Jore
Subject Re: when to use char, varchar or text
Date
Msg-id Pine.BSO.4.44.0205230731500.29256-100000@kitten.greentechnologist.org
Whole thread Raw
In response to when to use char, varchar or text  (Rory Campbell-Lange <rory@campbell-lange.net>)
List 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@campbell-lange.net>
> <www.campbell-lange.net>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


pgsql-novice by date:

Previous
From: Rory Campbell-Lange
Date:
Subject: when to use char, varchar or text
Next
From: Andrew McMillan
Date:
Subject: Re: optimising data load