问题描述
我正在Paralell中运行多个查询(在不同的会话中),这些查询使用以下代码,有时在Paralell中,有时会收到错误消息,指出临时表已经存在。我的印象是临时表将在后台处理中使用某种随机名称,因此它们不会互相干扰:
select country_id,product_category_id,sum(units) as total_units
into temp totals
from schema.table
group by country_id,product_category_id;
我得到这个:
Postgres版本为9.4,仅在使用pgbouncer端口时发生
我做错什么了吗?我应该改用创建临时表吗?
谢谢
解决方法
这是设置的pgbouncer,我们将pool_mode设置为 transaction ,一旦将其更改为 session ,它就可以正常工作