在同时运行的查询上使用的速度表已经存在错误

我正在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端口时发生

我做错什么了吗?我应该改用创建临时表吗?

谢谢

iCMS 回答:在同时运行的查询上使用的速度表已经存在错误

这是设置的pgbouncer,我们将pool_mode设置为 transaction ,一旦将其更改为 session ,它就可以正常工作

本文链接:https://www.f2er.com/1504773.html

大家都在问