Re: VARCHAR ( n )

From: Axel Schwenke <axel.schwenke_at_gmx.de>
Date: Wed, 23 Nov 2016 09:32:57 +0100
Message-ID: <o13k6m$l6t$1_at_dont-email.me>


On 22.11.2016 14:27, Stefan Ram wrote:
> Axel Schwenke <axel.schwenke_at_gmx.de> writes:

>> it is good practice to always use
>> the smallest possible data type

>
> The problem is that there often is no precise
> upper limit for the length of some kind of data (texts).

So what?

You always have practical limits. The number of character in a book is limited, because size and number of pages has an upper limit and the character size has a lower limit.

Of course you could print in microdots, use pages of 10mē and stack 10 million of those pages. But nobody would call that a book any more.

> For example, a first name usually is no longer
> than 32 characters, but when one uses VARCHAR ( 32 ),
> it might happen that eventually someone with
> 33 characters in his first name comes along. So,
> one might use VARCHAR ( 33 ), but then someone
> with 34 characters might appear.

Again. So what?

There are also practical limits for first names. You cannot print an arbitrary number of characters in a passport, on a business card, a flight ticket or any other place where first names usually go.

If you are not sure what a good limit is, imagine (or research) what a practical upper limit could be and then double it. Done. Received on Wed Nov 23 2016 - 09:32:57 CET

Original text of this message