PostgreSQL数据库如果不存在则插入,存在则更新

 

 INSERT INTO test_postgre(id,name,InputTime,age)

VALUES('1','postgre','2018-01-10 22:00:00',24)

ON conflict(id)

DO UPDATE SET name = 'postgreOk', InputTime ='2018-02-22 12:00:00'

 

 

 

来自:https://blog.csdn.net/likawei1314/article/details/79029145?utm_source=blogxgwz2

posted @ 2019-10-28 17:14  好人卡收藏家  阅读(1171)  评论(0编辑  收藏  举报