sql - 使临时表永久化
问题描述
对于temp table
temp_data
我只是在使用
CREATE TABLE perm_data as (SELECT * FROM temp_data);
有没有比创建表的完整副本更有效的方法?
解决方案
没有办法将临时表更改为永久表,至少没有比复制完整表更好的方法。
试图通过改变模式来欺骗 PostgreSQL 将导致
ERROR: cannot move objects into or out of temporary schemas
推荐阅读
- reactjs - 太多的重新渲染。React 限制渲染次数以防止无限循环错误
- django - django 如何获取 django allauth 中的所有用户
- javascript - 从 ExecuteScriptAsync 与 WebView2 返回的结果不正确
- machine-learning - 我应该在深度神经网络中最终层之前的层中使用哪个激活函数?
- java - Java S3 API:文件在 S3 浏览器中未正确显示
- java - 如果仅提前或落后 5 分钟,如何四舍五入到最近的时间?
- python - 如何在 discord.py 中设置禁止命令而不禁止管理员?
- excel - 寻找 <>VBA <>复制<> 粘贴<>特定数据
- c++ - 在测量代码的运行时,我将如何使用执行代码来求解矩阵?
- php - WooCommerce 添加到购物车动态创建的产品变体