Postgres 和临时表
我有一个使用临时表的存储过程,并在完成后显式删除它。
当两个不同的会话同时运行相同的过程时会发生什么?会话作为单用户(webapp)运行。
一个会话是否会干扰其他会话的临时表及其内部数据?
我正在使用 Postgres 9.0。
I have a stored procedure that use temp table and explicitly drops it when done.
What happed when same procedure is run at same time by 2 different sessions? Sessions are run as single user (webapp).
Will one session interfere with temp table, and data inside it, of other session?
I'm using Postgres 9.0.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在postgresql 临时表对于每个会话都是唯一的,所以没问题。
In postgresql temporary tables are unique for each session, so no problem.
如果我没有完全错的话,结果将是在生成临时表的过程中每个查询都有一个临时表,因此两个临时表不会互相干扰。
If I am not totally wrong, the result would be one temp table per query in your procedure which generates the temp table, so the two temp tables would not disturb eachother.