Register
Thursday, September 09, 2010
 
 DBAs And ProgrammersBlog
  
News! Minimize
   
 
 Print   
 
Misc Blog Stuff Minimize
   
 
 Print   
 
The Reluctant DBA Minimize
 
 
 
 Print   
 
Reluctant DBA Minimize
   
 
  
 
Reluctant DBA Minimize
   
 
  
 
The Reluctant DBA Minimize
 
Jan6

Written by:CarpDeus
1/6/2009 9:22 AM 

That may sound like a mundane question, but to a database designer, it's rather important. If you take a moment and review all of the email addresses you've ever had or all of those you've known, then you probably would assume that 100, 150 characters should be long enough. But that's only a good assumption until it gets broken. And, if you are a programmer building in constraint checks, is the following a valid email address:

777ACE43B87D476C98AD7B2D173FCB6F8385EA80E9A24EC98BDC56C24393043AEC98BD@yourcompany.example

It's 84 characters long, but it isn't valid. Why? Because the local part (before the @) can only be 64 characters long. That's according to RFC 5321, in the section Size Limits and Minimums. Which means a maximum email length would be 320 characters. Which is, in all probability, something you wouldn't encounter on a regular basis but you know that the one time you do will be the time that you get the Binary Data Would be Truncated error because the boss is showing it off to a client who has a valid yet impossibly long email address.

So, whenever possible, find the max as defined by standards and use it. Then blog about it so you can keep it handy for future reference ;)

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment  Cancel 
 
 
  
 
Privacy Statement | Terms Of Use Copyright 2001-2008 by ReluctantDBA.com