PGSQL 创建临时表


CREATE TEMPORTY TABLE TMP_TESTABC (ID INT4,NAME TEXT)

 生成临时表(会话结束后会自动删除)

创建临时表 select * into temp table tmp0 from xxx 
一、根据原表创建临时表

CREATE TEMP TABLE tmp_test as (select * from test limit 0);
 

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

CREATE TEMP TABLE temp_ads ON COMMIT DROP as (select * from testbulkcopy limit 0);
ON COMMIT DROP  本次事务提交后自动删掉