Postgresql的临时表的用法

一、根据原表创建临时表

CREATE TEMP TABLE temp_testbulkcopy as (select * from testbulkcopy limit 0);

 

二、本次使用完临时表后自动删除

CREATE TEMP TABLE temp_testbulkcopy ON COMMIT DROP as (select * from testbulkcopy limit 0);

ON COMMIT DROP  表示本次事务提交后就自动删掉

 

posted @ 2021-08-17 17:04  Thenext  阅读(464)  评论(0)    收藏  举报