Re: varchar lengths

From: Arjen Nienhuis <a(dot)g(dot)nienhuis(at)gmail(dot)com>
To: "Massa, Harald Armin" <chef(at)ghum(dot)de>
Cc: Marcus Engene <mengpg2(at)engene(dot)se>, POSTGRESQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: varchar lengths
Date: 2010-09-21 12:40:30
Message-ID: AANLkTimn_2XatLiQf5jE_U116txEQHs=Gp6g680tuc8C@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 21, 2010 at 1:23 PM, Massa, Harald Armin <chef(at)ghum(dot)de> wrote:

> I recommend to use TEXT as type for that kind of columns.
> 99 out of 100 theories about "this value will never be longer then xx
> characters" fail in the long run.
>
> And "text", limited only by PostgreSQLs limits, performs as good or
> better then varchar(length_limit) The time of "we only can allow n
> chars for first name" for performance reasons have gone by, together
> with walkmen and VHS.
>

You do need to be wary of malicious users who put a first name of a few
hundred megabytes.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Massa, Harald Armin 2010-09-21 13:15:22 Re: varchar lengths
Previous Message Christopher Gorge A. Marges 2010-09-21 12:39:39 Reclaiming space