尝试使用postgres从t插入表s时出现错误,
INSERT INTO s (name, site_square_footage)
SELECT name, site_square_footage
FROM temp_sites AS t
ON CONFLICT (name)
DO UPDATE SET
site_square_footage = t.site_sqaure_footage
请帮助,谢谢!
答案 0 :(得分:0)
我通过参考postgres文档找出答案,语法有点奇怪。
INSERT INTO s (name, site_square_footage)
SELECT name, site_square_footage
FROM temp_sites AS t
ON CONFLICT (name)
DO UPDATE SET
site_square_footage = excluded.site_sqaure_footage