将数据insert进数据库时,需要记录插入的日期或者时间戳。
日期和时间戳要能够自动记录。
环境:
pdAdmin4
A 插入日期
1.创建insert_date字段:
表下面 Columns右键 --- Create --- Column
2.选择类型和代码:
Defintion --- Data type --- date
Defintion --- Default Value --- ('now'::text)::date
B 插入时间戳
1.创建insert_timestamp字段:
表下面 Columns右键 --- Create --- Column
2.选择类型和代码:
Defintion --- Data type --- timestamp with time zone
Defintion --- Default Value --- now()
原创内容,抄袭必究
---20190808
---David.Ocean