[ale] Win ODBC --> Linux postgreSQL

Allan Metts ametts2 at mindspring.com
Wed Oct 11 08:39:12 EDT 2006


Does anyone have experience debugging Windows ODBC database 
connections to a Linux database?  I have some database work to do for 
an upcoming proposal -- and what I need to do would go much smoother 
if I could connect directly to our data center's postgresql 
installation using MS Excel and MS Access.

I set up the server's postgres installation with odbc, and have 
verified connectivity to it on that machine using isql (also running 
on this server) from the unixODBC package.  Postgresql is listening 
on localhost port 5432 (which is not visible to the outside world).

I set up a ssh tunnel on port 5432.

Then I downloaded, installed, and configured the Windows ODBC drivers 
for PostgreSQL, and they fail to connect.  telnetting to localhost 
5432 on the client seems to indicate some sort of listener out there. 
The relevant traces appear below.

Anyone ever been here before?

Allan



-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

conn=1233a10, PGAPI_DriverConnect( in)='DSN=PostgreSQL30;', fDriverCompletion=1
DSN info: 
DSN='PostgreSQL30',server='localhost',port='5432',dbase='metts1',user='allan',passwd='xxxxx'
           onlyread='0',protocol='7.4',showoid='0',fakeoidindex='0',showsystable='0'
           conn_settings='',conn_encoding='OTHER'
           translation_dll='',translation_option=''
Global Options: Version='08.02.0100', fetch=100, socket=4096, 
unknown_sizes=0, max_varchar_size=254, max_longvarchar_size=8190
                 disable_optimizer=1, ksqo=1, unique_index=1, 
use_declarefetch=0
                 text_as_longvarchar=1, unknowns_as_longvarchar=0, 
bools_as_char=1 NAMEDATALEN=64
                 extra_systable_prefixes='dd_;', conn_settings='' 
conn_encoding='OTHER'
CONN ERROR: func=original_CC_connect, desc='', errnum=210, 
errmsg='Unexpected protocol character=''
             ------------------------------------------------------------
             henv=12321a0, conn=1233a10, status=0, num_stmts=16
             sock=12321d0, stmts=1232298, lobj_type=-999
             ---------------- Socket Info -------------------------------
             socket=260, reverse=0, errornumber=10, errormsg='Socket 
has been closed.'
             buffer_in=19096896, buffer_out=19101000
             buffer_filled_in=0, buffer_filled_out=0, buffer_read_in=0
CONN ERROR: func=PGAPI_DriverConnect, desc='Error from CC_Connect', 
errnum=210, errmsg='Unexpected protocol character=''
             ------------------------------------------------------------
             henv=12321a0, conn=1233a10, status=0, num_stmts=16
             sock=12321d0, stmts=1232298, lobj_type=-999
             ---------------- Socket Info -------------------------------
             socket=260, reverse=0, errornumber=10, errormsg='Socket 
has been closed.'
             buffer_in=19096896, buffer_out=19101000
             buffer_filled_in=0, buffer_filled_out=0, buffer_read_in=0

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

[3244]globals.extra_systable_prefixes = 'dd_;'
[3244][[SQLAllocHandle]][3244]**** in PGAPI_AllocEnv **
[3244]** exit PGAPI_AllocEnv: phenv = 12321a0 **
[3244][[SQLSetEnvAttr]] att=200,2
[3244][[SQLAllocHandle]][3244]PGAPI_AllocConnect: entering...
[3244]**** PGAPI_AllocConnect: henv = 12321a0, conn = 1233a10
[3244]EN_add_connection: self = 12321a0, conn = 1233a10
[3244]       added at i =0, conn->henv = 12321a0, conns[i]->henv = 12321a0
[3244][SQLGetInfo(30)][3244]PGAPI_GetInfo: entering...fInfoType=77
[3244]PGAPI_GetInfo: p='03.00', len=0, value=0, cbMax=12
[3244][[SQLSetConnectAttr]] 103
[3244]PGAPI_SetConnectAttr for 1233a10: 103 2d
[3244]PGAPI_SetConnectOption: entering fOption = 103 vParam = 45
[3244][SQLDriverConnect][3244]PGAPI_DriverConnect: entering...
[3244]**** PGAPI_DriverConnect: fDriverCompletion=1, 
connStrIn='DSN=PostgreSQL30;'
[3244]our_connect_string = 'DSN=PostgreSQL30;'
[3244]attribute = 'DSN', value = 'PostgreSQL30'
[3244]copyAttributes: 
DSN='PostgreSQL30',server='',dbase='',user='',passwd='xxxxx',port='',onlyread='',protocol='',conn_settings='',disallow_premature=-1)
[3244]getDSNinfo: DSN=PostgreSQL30 overwrite=0
[3244]rollback_on_error=1
[3244]force_abbrev=0 bde=0
[3244]globals.extra_systable_prefixes = 'dd_;'
[3244]our_connect_string = 'DSN=PostgreSQL30;'
[3244]attribute = 'DSN', value = 'PostgreSQL30'
[3244]CopyCommonAttributes: 
A7=100;A8=4096;A9=0;B0=254;B1=8190;B2=1;B3=1;B4=1;B5=1;B6=0;B7=1;B8=0;B9=1;C0=0;C1=0;C2=dd_;[3244]calling 
getDSNdefaults
[3244]CC_connect: entering...
[3244]sslmode=disable
[3244]original_CC_connect: entering...
[3244]original_CC_connect: DSN = 'PostgreSQL30', server = 
'localhost', port = '5432', database = 'metts1', username = 'allan', 
password='xxxxx'
[3244]connecting to the server socket...
[3244]connection to the server socket succeeded.
[3244]sizeof startup packet = 76
[3244]sent the authentication block.
[3244]sent the authentication block successfully.
[3244]gonna do authentication
[3244]read -1, global_socket_buffersize=4096
[3244]Lasterror=10035
[3244]read 9, global_socket_buffersize=4096
[3244]auth got 'R'
[3244]areq = 3
[3244]in AUTH_REQ_PASSWORD
[3244]past need password
[3244]past flush
[3244]read -1, global_socket_buffersize=4096
[3244]Lasterror=10035
[3244]read 0, global_socket_buffersize=4096
[3244]socket error=10 Socket has been closed.
[3244]auth got '



-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


msqry32         d18-c38	EXIT  SQLAllocConnect  with return code 0 (SQL_SUCCESS)

		HENV                00881540

		HDBC *              0x0012EEF4 ( 0x00881750)



msqry32         d18-c38	ENTER SQLSetConnectOption

		HDBC                00881750

		SQLINTEGER                 103 <SQL_LOGIN_TIMEOUT>

		SQLPOINTER          0x0000002D



msqry32         d18-c38	EXIT  SQLSetConnectOption  with return code 0 
(SQL_SUCCESS)

		HDBC                00881750

		SQLINTEGER                 103 <SQL_LOGIN_TIMEOUT>

		SQLPOINTER          0x0000002D (BADMEM)



msqry32         d18-c38	ENTER SQLDriverConnectW

		HDBC                00881750

		HWND                000702FC

		WCHAR *             0x74329A38 [      -3] "******\ 0"

		SWORD                       -3

		WCHAR *             0x74329A38

		SWORD                        2

		SWORD *             0x00000000

		UWORD                        1 <SQL_DRIVER_COMPLETE>



msqry32         d18-c38	EXIT  SQLDriverConnectW  with return code -1 
(SQL_ERROR)

		HDBC                00881750

		HWND                000702FC

		WCHAR *             0x74329A38 [      -3] "******\ 0"

		SWORD                       -3

		WCHAR *             0x74329A38

		SWORD                        2

		SWORD *             0x00000000

		UWORD                        1 <SQL_DRIVER_COMPLETE>



		DIAG [28000] Unexpected protocol character=';
Socket has been closed. (210)




More information about the Ale mailing list