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 @ 2020-06-17 19:31  星星c#  阅读(4170)  评论(0编辑  收藏  举报