Re: [INTERFACES] psqlodbc

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: MrLinux(at)applix(dot)com, Aleksey Demakov <avd(at)gcom(dot)ru>, David Hartwig <daybee(at)bellatlantic(dot)net>, Byron Nikolaidis <byronn(at)insightdist(dot)com>
Cc: Postgres Interfaces Mailing List <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] psqlodbc
Date: 1998-08-01 17:08:32
Message-ID: 35C34B90.E761CD8D@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

OK, I've gotten a ways farther; here is the current status on the
ApplixWare->Postgres interface via iODBC using the Insight driver:

1) The psqlodbc driver does not use a hardcoded database name as I had
reported earlier; there is some fallback code which does but that is not
getting executed.

2) ApplixWare/iodbc is handing the psqlodbc driver a registry "section"
name string which has a trailing blank. So, the driver was never finding
a match in the .odbc.ini file for that block because it wasn't stripping
blanks from the target strings (it does strip blanks correctly from the
.ini file entries themselves). I brute-force fixed that by stripping the
blanks in the psqlodbc .ini reader (in gpps.c), but we should fix it
when the driver gets the string from the app. Any idea where that is?

3) The driver appears to successfully complete a few of the transactions
involved in starting up the database connection, including one or two
queries. It returns from SQLConnect() with a SQL_SUCCESS return code.

4) After that point Applix reports a "broken pipe". Log info from the
"psqlodbc" and "mylog" debugging files is at the end of the mail. It
looks like SQLConnect() is returning, but I don't know what should
happen next to see where things are bombing out.

So, questions:
Does anyone have a suggestion on which driver routines get called by
Applix/iodbc and in what order? Is there any debugging I can turn on in
Applix or in the iodbc driver? Any ideas on where to look next?

- Tom

golem> cat psqlodbc.log
DSN info:
DSN='PostgreSQL',server='localhost',port='5432',dbase='test',user='tgl',passwd=''

readonly='',protocol='',showoid='',fakeoidindex='',showsystable=''
conn_settings=''
translation_dll='',translation_option=''
conn = 134611560, SQLConnect(DSN='PostgreSQL', UID='tgl', PWD='doh')
SQLConnect- calling CC_connect...
Global Options: fetch=100, socket=4096, unknown_sizes=0,
max_varchar_size=254, max_longvarchar_size=4094
disable_optimizer=1, unique_index=0, use_declarefetch=1
text_as_longvarchar=1, unknowns_as_longvarchar=0,
bools_as_char=1
extra_systable_prefixes='dd_;', conn_settings=''
conn=134611560, query=' '
SQLConnect- return SQL_SUCCESS

golem> cat mylog.log
**** in SQLAllocEnv **
** exit SQLAllocEnv: phenv = 134611544 **
**** SQLAllocConnect: henv = 134611544, conn = 134611560
EN_add_connection: self = 134611544, conn = 134611560
added at i =0, conn->henv = 134611544, conns[i]->henv = 134611544
gpps- try opening /home/tgl/.odbc.ini
gpps- look in file /home/tgl/.odbc.ini section PostgreSQL for field
Description
<snip lots of debugging statements for reading the .ini file>
gpps- found section ODBC
gpps- check key InstallDir
CC_connect(): DSN = 'PostgreSQL', server = 'localhost', port = '5432',
database = 'test', username = 'tgl', password='doh'
connecting to the server socket...
connection to the server socket succeeded.
sizeof startup packet = 292
sent the authentication block.
sent the authentication block successfully.
gonna do authentication
read 5, global_socket_buffersize=4096
auth got 'R'
areq = 0
sending an empty query...
send_query(): conn=134611560, query=' '
send_query: done sending query
read 2, global_socket_buffersize=4096
send_query: got id = 'I'
in QR_Constructor
exit QR_Constructor
QResult: in DESTRUCTOR
QResult: free memory in, fcount=0
QResult: free memory out
QResult: exit DESTRUCTOR
empty query seems to be OK.
**** SQLAllocStmt: hdbc = 134611560, stmt = 134626288
CC_add_statement: self=134611560, stmt=134626288
Sending Initial Connection query: 'set DateStyle to 'ISO'; set geqo to
'OFF''
**** SQLExecDirect: hstmt=134626288, statement='set DateStyle to 'ISO';
set geqo to 'OFF''
SQLExecDirect: calling SQLExecute
**** enter SQLFreeStmt: hstmt=134626288, fOption=1
SC_Destructor: self=134626288, self->result=0, self->hdbc=134611560
SC_free_params: ENTER, self=134626288
SC_Destructor: EXIT
**** SQLAllocStmt: hdbc = 134611560, stmt = 134626288
CC_add_statement: self=134611560, stmt=134626288
**** SQLExecDirect: hstmt=134626288, statement='select oid from pg_type
where typname='lo''
SQLExecDirect: calling SQLExecute
**** enter SQLFreeStmt: hstmt=134626288, fOption=1
SC_Destructor: self=134626288, self->result=0, self->hdbc=134611560
SC_free_params: ENTER, self=134626288
SC_Destructor: EXIT
CC_connect- returning SQL_SUCCESS

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Bartlomiej Papierski 1998-08-01 17:10:08 compiling jdbc with JDK 1.1.3
Previous Message Thomas G. Lockhart 1998-07-31 15:27:10 Re: [INTERFACES] psqlodbc