postgresql
数据类型
Integres 只支持整数 速度快 有边界
1 | DROP TABLE IF EXISTS Users; |
Numeric 精准的数字 速度慢 无边界
1 | CREATE TABLE numeric_example( |
Floating-point 小数 会丢失进度 速度快
1 | CREATE TABLE real_example( |
money 货比问题,精度问题 不建议使用 推荐使用 int * 100
1 | CREATE TABLE money_example( |
NaN not a number and Infiity 无穷大
text 建议使用 text 不要使用固定长度 char
check-constraints
1 | create table check_example( |
Domain
1 | CREATE DOMAIN us_postal_code as text constraint format check ( |