pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: charlie clark <charlie@begeistert.org>
To: pgsql-odbc@postgresql.org
Subject: PostgreSQL, ODBC and long strings
Date: Wed, 11 May 2005 21:22:42 +0200
Message-ID: <opsqmlf4yoyt02yl@mail.isis.de> (raw)

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



Message-ID: <opsqmlf4yoyt02yl@mail.isis.de>
Permalink:  ../opsqmlf4yoyt02yl@mail.isis.de/
Also on:    postgresql.org/message-id/opsqmlf4yoyt02yl@mail.isis.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: charlie@begeistert.org
  Subject: Re: PostgreSQL, ODBC and long strings
  In-Reply-To: <opsqmlf4yoyt02yl@mail.isis.de>
  References: <opsqmlf4yoyt02yl@mail.isis.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox