What is a reasonable length limit on person “Name” fields?

后端 未结 11 990
心在旅途
心在旅途 2020-12-22 18:45

I have a simple webform that will allow unauthenticated users to input their information, including name. I gave the name field a limit of 50 characters to coincide with my

相关标签:
11条回答
  • 2020-12-22 18:49

    We use 50.

    0 讨论(0)
  • 2020-12-22 18:53

    UK Government Data Standards Catalogue suggests 35 characters for each of Given Name and Family Name, or 70 characters for a single field to hold the Full Name.

    0 讨论(0)
  • 2020-12-22 19:00

    If it's full name in one field, I usually go with 128 - 64/64 for first and last in separate fields - you just never know.

    0 讨论(0)
  • 2020-12-22 19:02

    I know I'm late on this one, but I'll add this comment anyway, as others may well come here in the future with similar questions.

    Beware of tweaking column sizes dependent on locale. For a start, it sets you up for a maintenance nightmare, leaving aside the fact that people migrate, and take their names with them.

    For example, Spanish people with those extra surnames can move to and live in an English-speaking country, and can reasonably expect their full name to be used. Russians have patronymics in addition to their surnames, some African names can be considerably longer than most European names.

    Go with making each column as wide as you can reasonably do, taking into account the potential row count. I use 40 characters each for first name, other given names and surname and have never found any problems.

    0 讨论(0)
  • 2020-12-22 19:05

    What you're really asking is a related, but substantially different question: how often do I want to truncate names in order to fit them in the database? The answer depends both on the frequency of different lengths of names as well as the maximum lengths chosen. This concern is balanced by the concerns about resources used by the database. Considering how little overhead difference there is between different max lengths for a varchar field I'd generally err on the side of never being forced to truncate a name and make the field as large as I dared.

    0 讨论(0)
  • 2020-12-22 19:07

    I usually go with varchar(255) (255 being the maximum length of a varchar type in MySQL).

    0 讨论(0)
提交回复
热议问题