Re: Fixed width rows faster? - Mailing list pgsql-performance

From Christopher Kings-Lynne
Subject Re: Fixed width rows faster?
Date
Msg-id 4049A16E.1040606@familyhealth.com.au
Whole thread Raw
In response to Re: Fixed width rows faster?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
> If you have an actual business-logic requirement to restrict a field to
> no more than N characters, then by all means use varchar(N); that's
> what it's for.  But I agree with what I think Josh meant: there is very
> seldom any non-broken reason to have a hard upper limit on string
> lengths.  If you think you need varchar(N) you should stop and ask
> why exactly.  If you cannot give a specific, coherent reason why the
> particular value of N that you're using is the One True Length for the
> field, then you really need to think twice.

One nice reason to have like VARCHAR(4096) or whatever is that if there
is a bug in your website and you forget to length check some user input,
it stops them from screwing you by uploading megs and megs of data into
a 'firstname' field, say.

Chris


pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fixed width rows faster?
Next
From: "Eric Jain"
Date:
Subject: Re: Fixed width rows faster?