X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DF3CB53BA9 for ; Wed, 11 May 2005 16:23:34 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 70841-03 for ; Wed, 11 May 2005 19:23:30 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by svr1.postgresql.org (Postfix) with ESMTP id 78618536EE for ; Wed, 11 May 2005 16:23:25 -0300 (ADT) Received: from isi-dsl-103-4.isionline-dialin.de[213.128.103.4] (helo=gormenghast) by mrelayeu.kundenserver.de with ESMTP (Nemesis), id 0MKwtQ-1DVwnh1dut-0002k2; Wed, 11 May 2005 21:23:21 +0200 To: pgsql-odbc@postgresql.org Subject: PostgreSQL, ODBC and long strings From: charlie clark Content-Type: text/plain; format=flowed; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Wed, 11 May 2005 21:22:42 +0200 Message-ID: User-Agent: Opera7.23/Win32 M2 build 3227 X-Provags-ID: kundenserver.de abuse@kundenserver.de login:8c2a76220e21e6d701ad8ab7dcd4a511 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200505/30 X-Sequence-Number: 5333 Further to my earlier post I have done some investigating. It turns out the problems is with all strings greater than 255 characters which are automatically converted to LO. The statement of the form cursor.execute("SELECT value FROM table WHERE x = ?", (a_value, )) where a_value is a string longer than 255 characters always generates an error of the form ProgrammingError: ('HY000', 7, 'ERROR: type "lo" does not exist', 5898) The ODBC.log STATEMENT ERROR: func=SC_execute, desc='', errnum=7, errmsg='Error while executing the query' ------------------------------------------------------------ hdbc=28785640, stmt=28779072, result=28813312 manual_result=0, prepare=1, internal=0 bindings=0, bindings_allocated=0 parameters=28817032, parameters_allocated=1 statement_type=0, statement='SELECT id FROM localekit_attributes where attribute = ?' stmt_with_params='SELECT id FROM localekit_attributes where attribute = '829028'::lo' data_at_exec=-1, current_exec_param=-1, put_data=0 currTuple=-1, current_col=-1, lobj_fd=-1 maxRows=0, rowset_size=1, keyset_size=0, cursor_type=0, scroll_concurrency=1 cursor_name='SQL_CUR01B72240' ----------------QResult Info ------------------------------- fields=28815040, manual_tuples=0, backend_tuples=0, tupleField=0, conn=0 fetch_count=0, num_total_rows=0, num_fields=0, cursor='(NULL)' message='ERROR: operator does not exist: text = lo', command='(NULL)', notice='(NULL)' status=7, inTuples=0 CONN ERROR: func=SC_execute, desc='', errnum=110, errmsg='ERROR: type "lo" does not exist' ------------------------------------------------------------ henv=28785584, conn=28785640, status=1, num_stmts=16 sock=28778336, stmts=28815080, lobj_type=-999 ---------------- Socket Info ------------------------------- socket=600, reverse=0, errornumber=0, errormsg='(NULL)' buffer_in=34283600, buffer_out=34291800 buffer_filled_in=11, buffer_filled_out=0, buffer_read_in=11 It seems that the ODBC driver is not returning enough information about the datatype text and that the Python ODBC driver is automatically converting to a large object for strings more than 255 characters in length. What possible solutions are there to this problem? defining the lo type? or improving the information provided by the ODBC driver? Thanks for any pointers Charlie -- Charlie Clark Helmholtzstr. 20 Düsseldorf D-40215 Tel: +49-211-938-5360 GSM: +49-178-782-6226