varchar vs Text & TOAST

From: Ow Mun Heng <Ow(dot)Mun(dot)Heng(at)wdc(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: varchar vs Text & TOAST
Date: 2008-09-08 03:58:24
Message-ID: 1220846304.30796.5.camel@neuromancer.home.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I'm a (more than a) bit confuse as to the diference between TEXT and
varchar data-types.

AFAIK, varchar will have a max limit char of, if not mistaken ~65k? But
for TEXT, it's more like a BLOB and there's supposed to be no limit?

Anyhow, searching the archives (in my mail client - no internet at the
moment), I see references that when I use TEXT, I will create TOAST
tables which will have them lie _outside_ of my main data table.

I'm not sure what is the implications or etc. I'm wondering if I should
change my current usage of TEXT to varchar.

the columns will have data like

NULL:NULL:FLE:NULL:FLE:NULL:FLE:FLE

I initially chose TEXT, (for X reasons) and now since I found out about
the TOAST tables, (oh.. i didn't like the TOAST tables cos it's created
_not_ in my usual raidspace, but in my OS drive), I'm trying to
determine if I need to change the data-type.

comments? Advise?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-09-08 04:06:50 Re: 64-bit Compile Failure on Solaris 10 with OpenSSL
Previous Message Peter Cai 2008-09-08 03:51:32 Very weird problem of "order by" in postgresql