createtabletest(idintprimarykey, info text, crt_timetimestamp); withupsertas(updatetestsetinfo='test',crt_time=now()whereid=1 returning *)insertintotestselect1,'test',now()wherenotexists (select1fromupsertwhereid=1); PostgreSQL 9.5+ PostgreSQL 9.5 引入了一項(xiàng)新功能,UPSERT(insert on conflict ...
www.dbjr.com.cn/article/2048...htm 2025-6-7