> I'm trying to store anywhere from a few words to a half page of text as a
> field in my table. A fellow db programmer told me that better than using a
> varchar is to break the message up into n pieces of size m (let's say
m=100),
>
> and make n (or n+1) varchar(m)s, and relate them together.
If the text needs to be stored together, there isn't anything wrong with
using a text type field. Keep in mind that in 7.0.3 there is an 8k limit on
text fields (unless you increased it at compile time) and that in any
PostgreSQL you can't directly index text fields (though there is some stuff
in contrib that can help)..
> He is worried that varchars allocate and hold space.
Do you mean many varchar fields will take up more space than a single text
field both holding the same information? I don't know for sure but I'd say
that's true -- it's probably a pretty small different though (well,
depending on what the total amount of data we're talking about is).
> I'm not sure if that is actually more efficient, nor do I know the limit
> of how big you can make a varchar.
I think I remember Tom saying it was around 2100 bytes. I could be pretty
far off on that though.
Oh -- Update to 7.1 if you can, it's *really* nice...
-Mitch