Re: varchar vs. text

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Garriss <mgarriss(at)earthlink(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: varchar vs. text
Date: 2003-09-18 04:27:20
Message-ID: 8493.1063859240@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Garriss <mgarriss(at)earthlink(dot)net> writes:
> I curious about the benefits of a varchar over text.

1. Compliance to the letter of the SQL spec.
2. Ability to define a maximum length, if you happen to feel the need to
impose a specific maximum length. (If you don't have a good reason
to impose any particular max length, this is a minus not a plus,
because the spec says you have to pick one anyway.)

> Is it speed,

It's a loser on speed because of the extra cycles spent to check the
max length. Other than those cycles, there is no difference.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Garriss 2003-09-18 04:36:59 Re: varchar vs. text
Previous Message Tom Lane 2003-09-18 04:21:40 Re: [PATCHES] backend crashing despite tsearch2 patch