首页 > 解决方案 > 使临时表永久化

问题描述

对于temp table temp_data我只是在使用

CREATE TABLE perm_data as (SELECT * FROM temp_data);

有没有比创建表的完整副本更有效的方法?

标签: sqlpostgresql

解决方案


没有办法将临时表更改为永久表,至少没有比复制完整表更好的方法。

试图通过改变模式来欺骗 PostgreSQL 将导致

ERROR:  cannot move objects into or out of temporary schemas

推荐阅读