Postgres SSL SYSCALL错误:使用python和psycopg检测到EOF [英] Postgres SSL SYSCALL error: EOF detected with python and psycopg

查看:770
本文介绍了Postgres SSL SYSCALL错误:使用python和psycopg检测到EOF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在python 2.7中使用psycopg2包,我一直收到标题错误:psycopg2.DatabaseError:SSL SYSCALL错误:检测到EOF



仅当我添加 WHERE列,例如我的灌装查询中的%X% 子句。示例:

 选择id1作为节点,成本FROM PGR_Driving_Distance(
'SELECT id,来源,目标,成本
FROM edge_table
成本不为NULL且列类似``%x%''',
1,10,false,false)

互联网上的线程直观地表明这是SSL的问题,但是每当我注释掉模式匹配方面时,查询和数据库连接就可以正常工作



这是在运行Xubuntu 13.10的本地数据库上。



经过进一步调查:看起来像这样



将很快发布答案...

很快就会发布答案... p>

解决方案

在Digital Ocean实例上的Droplet中运行慢查询时,我遇到了这个问题。所有其他SQL都可以正常运行,并且可以在我的笔记本电脑上运行。在扩展到1 GB RAM实例而不是512 MB实例后,它可以正常工作,因此,如果进程内存不足,似乎会发生此错误。


Using psycopg2 package with python 2.7 I keep getting the titled error: psycopg2.DatabaseError: SSL SYSCALL error: EOF detected

It only occurs when I add a WHERE column LIKE ''%X%'' clause to my pgrouting query. An example:

SELECT id1 as node, cost FROM PGR_Driving_Distance(
  'SELECT id, source, target, cost 
     FROM edge_table
     WHERE cost IS NOT NULL and column LIKE ''%x%'' ',
  1, 10, false, false)

Threads on the internet suggest it is an issue with SSL intuitively, but whenever I comment out the pattern matching side of things the query and connection to the database works fine.

This is on a local database running Xubuntu 13.10.

After further investigation: It looks like this may be cause by the pgrouting extension crashing the database because it is a bad query and their are not links which have this pattern.

Will post an answer soon ...

解决方案

I ran into this problem when running a slow query in a Droplet on a Digital Ocean instance. All other SQL would run fine and it worked on my laptop. After scaling up to a 1 GB RAM instance instead of 512 MB it works fine so it seems that this error could occur if the process is running out of memory.

这篇关于Postgres SSL SYSCALL错误:使用python和psycopg检测到EOF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆