Re: varchar lengths - Mailing list pgsql-general

From Terry Lee Tucker
Subject Re: varchar lengths
Date
Msg-id 201009210729.27714.terry@chosen-ones.org
Whole thread Raw
In response to Re: varchar lengths  ("Massa, Harald Armin" <chef@ghum.de>)
Responses Re: varchar lengths  (Marcus Engene <mengpg2@engene.se>)
List pgsql-general
On Tuesday, September 21, 2010 07:23:45 Massa, Harald Armin 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.
>
>
> Harald

Also, if you are absolutely set on a constraint on the length of the text, you
can use a trigger for this and when the constraint changes, and it will, you
simply modify the trigger.

--
Terry Lee Tucker
tel: (336) 372-5432; cell: (336) 404-6897
terry@chosen-ones.org

pgsql-general by date:

Previous
From: "Massa, Harald Armin"
Date:
Subject: Re: varchar lengths
Next
From: Marcus Engene
Date:
Subject: Re: varchar lengths