On 9/21/10 1:29 , Terry Lee Tucker wrote:
> 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.
>
>
Thanks for your answers!
Richard was completely right of course. I hadn't actually tested this
since 8.0 but now it works splendidly. Apologies for the noise.
I do use text in several places but in some, where it's motivated, I
like to use constrained lengths. May it be tables that hold data that
goes to legacy systems, indexed columns (such as username) or the name
of a product.
Have a lovely tuesday everyone,
Marcus