If you don't really need to 工作 with a postal code, I would suggest not worrying about it. By work, I mean do special processing for rather than just use to print address labels and so on.
If the initial version of your application is going to support US and Canadian addresses (which I'm inferring from the fact that you call out those sizes in your question), I'd declare the field as VARCHAR2(9) (or VARCHAR2(10) if you intend to store the hyphen in ZIP+4 fields). Even looking at the posts others have made to postal codes across countries, VARCHAR2(9) or VARCHAR2(10) would be sufficient for the most if not all other countries.
一直以来,您总是可以更改列,以便在需要时增加列的长度。但是通常很难阻止某些人,在某些地方,由于某种原因(例如,因为他们想在发货标签上再加一行) ,决定“创造性地”将50个字符填入 VARCHAR2(50)字段。您还必须处理测试边界情况(是否每个显示 ZIP 的应用程序处理50个字符?).而且,当客户机从数据库中检索数据时,它们通常是根据将要获取的数据的最大大小来分配内存,而不是根据给定行的实际长度。在这个特定的情况下,可能不是什么大问题,但是在某些情况下,每行40字节可能是一个相当不错的 RAM 块。
另外,您还可以考虑分别存储(至少对于 US 地址)邮政编码和 + 4扩展名。一般来说,通过地理地区生成报告是很有用的,你可能经常想把所有的邮政编码放在一起,而不是通过 + 4扩展来分解。此时,不必尝试 SUBSTR 输出邮政编码的前5个字符是很有用的。