[Biopython-dev] [Bug 2734] db.load problem with postgresql and psycopg2

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Mon Feb 16 13:24:53 UTC 2009


http://bugzilla.open-bio.org/show_bug.cgi?id=2734





------- Comment #8 from biopython-bugzilla at maubp.freeserve.co.uk  2009-02-16 08:24 EST -------
(In reply to comment #7)
> Hi,
> the problem, according to me, is already solved.
> It seems that Stephen has an old version of Loader.py.

Well spotted Andrea - you may be right...

> I submitted a bug and patch that explain that for Postgres
> is not possible to have double quotes in queries ("). 
> Double quotes are reserved to Column names.
> 
> In the correct Loader.py version everything is corrected
> and there aren't double quotes in any queries at all.
> ...

Andrea is referring to Bug 2506, which was fixed in Loader.py CVS revision
1.31, which means it was included in Biopython 1.46 onwards.

Stephen said he was using Biopython 1.49, the error may be an out of date
Loader.py which is still using double quotes:

Quoting comment #0,
> ...
> pq_execute: executing SYNC query:
>    SELECT seqfeature_id, dbxref_id FROM seqfeature_dbxref WHERE seqfeature_id
>    = "3" AND dbxref_id = "6"
> pq_execute: entering syncronous DBAPI compatibility mode
> pq_fetch: pgstatus = PGRES_FATAL_ERROR
> pq_fetch: uh-oh, something FAILED
> pq_fetch: fetching done; check for critical errors
> psyco_curs_execute: res = -1, pgres = 0x0

Certainly the SQL command shown in the pg log has double quotes.

> Traceback (most recent call last):
>  ...
>  File "/Library/Python/2.5/site-packages/BioSQL/Loader.py", line 645, in
> _load_seqfeature_dbxref
>    self._get_seqfeature_dbxref(seqfeature_id, dbxref_id, rank+1)
>  File "/Library/Python/2.5/site-packages/BioSQL/Loader.py", line 679, in
> _get_seqfeature_dbxref
>    dbxref_id))
>  File "/Library/Python/2.5/site-packages/BioSQL/BioSeqDatabase.py", line 295,
> in execute_and_fetch_col0
>    self.cursor.execute(sql, args or ())

According to that traceback, line 679 in _get_seqfeature_dbxref is excuting
some bad SQL (presumably the double quotes).  This line number doesn't match up
for Biopython 1.49, so it probably is an older version of Biopython.

Stephen - maybe you have more than one copy of Biopython installed (e.g. and
old system level copy, and a new local copy)?  You could try deleting these
directories and then reinstalling Biopython:

/Library/Python/2.5/site-packages/Bio
/Library/Python/2.5/site-packages/BioSQL

Peter


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list