[Biopython-dev] BioSQL test code on Postgres
Peter
biopython at maubp.freeserve.co.uk
Tue Aug 31 10:38:37 UTC 2010
On Tue, Aug 31, 2010 at 10:11 AM, Cymon Cox <cy at cymon.org> wrote:
> Hi Peter,
>
> Nope. The bioentry_id parameter is already being passed as a string -
> psycopg automatically converts python objects into SQL literals (see
> http://initd.org/psycopg/docs/usage.html#the-problem-with-the-query-parameters
> ).
>
> Here is the same error using the psql interface:
>
> biosqldb=# select count(bioentry_id) from bioentry where biodatabase_id=1
> and bioentry_id='non-existant';
> ERROR: invalid input syntax for integer: "non-existant"
> ...
>
> Cheers, Cymon
I think I get it now - the bioentry_id is an integer (in all the schemas),
and PostgreSQL throws an error due to the type mismatch (we are
comparing it to a string) while MySQL and SQLite just return no
matches. How's this?:
http://github.com/biopython/biopython/commit/050963bd3bbd6653101306eed9aab6c629cf9375
Peter
More information about the Biopython-dev
mailing list