创建前可先删除drop table tmp0创建临时表select * into temp table tmp0 from xxx create index idx_tmp0_inner_cd on tmp0(inner_cd); 查看临时表是否创建,返回0表示未创建,1为创建select count(*) from pg_class where relname = 'tmp0' 或者用下面,下面语句在pg和mysql中都适用同样可以用在删除表中:DROP TABLE If Exists temp.mjp_temp_update_log应用例子: