Re: VARCHAR ( n )

From: Peter H. Coffin <hellsop_at_ninehells.com>
Date: Sun, 27 Nov 2016 12:32:35 -0600
Message-ID: <slrno3m9m3.ce4.hellsop_at_nibelheim.ninehells.com>


On 22 Nov 2016 12:38:55 GMT, Stefan Ram wrote:
> When a field usually has about 8 characters, but there is
> no absolute upper limit (think of the first name of a person),
> is there any drawback in specifying a VARCHAR argument that
> is much larger, say, for example, »VARCHAR ( 9999 )«?
>
> We can safely assume that no first name will have more than
> 100 characters, but is there any drawback to use an upper
> limit that is much larger? (in MySQL 5.7)

No real problem. Make it as big as you think you'll need.

Frankly, you're probably going to run into bigger problems dealing with the whole concept of "first name" "last name" than actual length issues.

What happens when Cher signs up? What happens when Nakamura Hiro signs up? What happens if Nakamura Hiro wants to be 中村比呂 instead?

-- 
"Only Irish coffee provides in a single glass all four essential food
 groups: alcohol, caffeine, sugar, and fat."
			    -Alex Levine
Received on Sun Nov 27 2016 - 19:32:35 CET

Original text of this message