下面是我的查询的提取部分,反映了 EMAIL_ADDRESS
列数据类型和属性:
EMAIL_ADDRESS CHARACTER VARYING(20) NOT NULL,
但是,John Saunders使用 VARYING(256)
。
这表明我没有必要正确地理解变化。
我的理解是,在我的情况下,电子邮件地址的长度是20个字符,而 Jodn 是256个字符。
约翰代码中的背景
CREATE TABLE so."User"
(
USER_ID SERIAL NOT NULL,
USER_NAME CHARACTER VARYING(50) NOT NULL,
EMAIL_ADDRESS CHARACTER VARYING(256) NOT NULL, // Here
HASHED_PASSWORD so.HashedPassword NOT NULL,
OPEN_ID CHARACTER VARYING(512),
A_MODERATOR BOOLEAN,
LOGGED_IN BOOLEAN,
HAS_BEEN_SENT_A_MODERATOR_MESSAGE BOOLEAN,
CONSTRAINT User_PK PRIMARY KEY(USER_ID)
);
我从来没有见过普通人使用超过20个字符的电子邮件地址。
数据库中电子邮件地址的最佳长度是多少?