【发布时间】:2015-06-08 11:21:51
【问题描述】:
您好,我一直在使用多处理方法从 here 更新一个巨大的 postgis 表,它工作得很好,但是我的表似乎没有得到更新,除非我在 commit; 语句/p>
procQuery = 'UPDATE city SET gid_fkey = gid FROM country WHERE ST_within((SELECT the_geom FROM city WHERE city_id = %s), country.the_geom) AND city_id = %s' % (self.a, self.a)
喜欢
procQuery = 'UPDATE city SET gid_fkey = gid FROM country WHERE ST_within((SELECT the_geom FROM city WHERE city_id = %s), country.the_geom) AND city_id = %s;commit;' % (self.a, self.a)
这可能是什么问题?
【问题讨论】:
-
这对你来说有什么意义?
commitupdate、insert或delete查询是 SQL 的事情。也许您认为您的数据库事务对象已将自动提交设置为 true。可能值得先检查一下。
标签: python postgresql parallel-processing multiprocessing psycopg2