Note that there are some explanatory texts on larger screens.

plurals
  1. POpgdb.connect() causes segmentation error in python 2.7.3
    primarykey
    data
    text
    <p>I just compiled and installed an instance of postgres 9.2.1. And python 2.7.3. On OpenSuSE 12.2, running on a xeon server. I then downloaded pygresql and tried to connect to database using pgdb but this crashes python. Here is the trace:</p> <pre><code>Retrieving package PyGreSQL-4.0-200.1.2.x86_64 (1/1), 85.0 KiB (402.1 KiB unpacked) Retrieving: PyGreSQL-4.0-200.1.2.x86_64.rpm ........................................................[done] Installing: PyGreSQL-4.0-200.1.2 ...................................................................[done] rikki:~/Downloads # python Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2 Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; import pgdb &gt;&gt;&gt; c=pgdb.connect() Segmentation fault </code></pre> <p>Using anything but "" or localhost or works "OK".</p> <pre><code>rikki:~/Downloads # python Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2 Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; import pgdb &gt;&gt;&gt; d=pgdb.connect(host="localhost") Segmentation fault rikki:~/Downloads # python Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2 Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; import pgdb &gt;&gt;&gt; d=pgdb.connect(host="zzzzzzzzzzzzzzz") Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "/usr/lib64/python2.7/site-packages/pgdb.py", line 482, in connect dbtty, dbuser, dbpasswd) pg.InternalError: could not translate host name "zzzzzzzzzzzzzzz" to address: Name or service not known &gt;&gt;&gt; </code></pre> <p>The database is accessible: rikki:~/Downloads # psql -U cw psql (9.2.2) Type "help" for help.</p> <pre><code>cw=# select now(); now ------------------------------ 2013-05-14 09:08:49.54825-07 (1 row) cw=# </code></pre> <p>At the same time I have a desktop with a similar installation that works fine.</p> <p>What should I be checking for in my installation?</p> <p>Thanks.</p> <p>--EDIT-- Trying with <code>psycopg2-2.5-py2.7</code> gives same kinds of error:</p> <pre><code>&gt;&gt;&gt; con=psycopg2.connect(host="z",db="cw",user="cw") Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "/usr/local/lib64/python2.7/site-packages/psycopg2/__init__.py", line 164, in connect conn = _connect(dsn, connection_factory=connection_factory, async=async) psycopg2.OperationalError: invalid connection option "db" &gt;&gt;&gt; con=psycopg2.connect(host="localhost",database="cw",user="cw") Segmentation fault </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload