Re: figuring out why I am having this issue - Mailing list pgsql-odbc

From Joel Fradkin
Subject Re: figuring out why I am having this issue
Date
Msg-id 004001c5af2e$7350d1c0$797ba8c0@jfradkin
Whole thread Raw
In response to Re: figuring out why I am having this issue  ("Dave Page" <dpage@vale-housing.co.uk>)
Responses Re: figuring out why I am having this issue
List pgsql-odbc

Joel Fradkin
I found the h file in the postgres source and included in my build path, but
many errors.

d:\joel\wazagua_src\psqlodbc\socket.c(62): error C2037: left of 'connInfo'
specifies undefined struct/union 'ConnectionClass_'
d:\joel\wazagua_src\psqlodbc\lobj.c(23): error C2061: syntax error :
identifier 'lo_creat'
d:\joel\wazagua_src\psqlodbc\lobj.c(23): error C2059: syntax error : ';'
d:\joel\wazagua_src\psqlodbc\lobj.c(23): error C2059: syntax error : 'type'
d:\joel\wazagua_src\psqlodbc\lobj.c(55): warning C4013: 'CC_send_function'
undefined; assuming extern returning int
d:\joel\wazagua_src\psqlodbc\lobj.c(58): warning C4013: 'lo_lseek'
undefined; assuming extern returning int
d:\joel\wazagua_src\psqlodbc\lobj.c(174): error C2146: syntax error :
missing ')' before identifier 'lobjId'
d:\joel\wazagua_src\psqlodbc\lobj.c(174): error C2144: syntax error :
'<Unknown>' should be preceded by '<Unknown>'
d:\joel\wazagua_src\psqlodbc\lobj.c(174): error C2144: syntax error :
'<Unknown>' should be preceded by '<Unknown>'
d:\joel\wazagua_src\psqlodbc\lobj.c(174): error C2143: syntax error :
missing ')' before 'identifier'
d:\joel\wazagua_src\psqlodbc\lobj.c(174): error C2081: 'Oid' : name in
formal parameter list illegal
d:\joel\wazagua_src\psqlodbc\lobj.c(174): error C2061: syntax error :
identifier 'lobjId'
d:\joel\wazagua_src\psqlodbc\lobj.c(174): error C2059: syntax error : ';'
d:\joel\wazagua_src\psqlodbc\lobj.c(174): error C2059: syntax error : ')'
d:\joel\wazagua_src\psqlodbc\lobj.c(175): error C2449: found '{' at file
scope (missing function header?)
d:\joel\wazagua_src\psqlodbc\lobj.c(188): error C2059: syntax error : '}'
d:\joel\wazagua_src\psqlodbc\info30.c(20): error C2065: 'ConnInfo' :
undeclared identifier
d:\joel\wazagua_src\psqlodbc\info30.c(20): error C2065: 'ci' : undeclared
identifier
d:\joel\wazagua_src\psqlodbc\info30.c(20): error C2037: left of 'connInfo'
specifies undefined struct/union 'ConnectionClass_'
d:\joel\wazagua_src\psqlodbc\info30.c(21): error C2143: syntax error :
missing ';' before 'type'
d:\joel\wazagua_src\psqlodbc\info30.c(22): error C2143: syntax error :
missing ';' before 'type'
d:\joel\wazagua_src\psqlodbc\info30.c(24): error C2275: 'RETCODE' : illegal
use of this type as an expression
        c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\sqltypes.h(134) : see declaration of 'RETCODE'
d:\joel\wazagua_src\psqlodbc\info30.c(24): error C2146: syntax error :
missing ';' before identifier 'result'
d:\joel\wazagua_src\psqlodbc\info30.c(24): error C2144: syntax error :
'<Unknown>' should be preceded by '<Unknown>'
d:\joel\wazagua_src\psqlodbc\info30.c(24): error C2144: syntax error :
'<Unknown>' should be preceded by '<Unknown>'
d:\joel\wazagua_src\psqlodbc\info30.c(24): error C2143: syntax error :
missing ';' before 'identifier'
d:\joel\wazagua_src\psqlodbc\info30.c(24): error C2065: 'result' :
undeclared identifier
d:\joel\wazagua_src\psqlodbc\info30.c(29): error C2065: 'len' : undeclared
identifier
d:\joel\wazagua_src\psqlodbc\info30.c(30): error C2065: 'value' : undeclared
identifier
d:\joel\wazagua_src\psqlodbc\info30.c(51): error C2223: left of
'->updatable_cursors' must point to struct/union
d:\joel\wazagua_src\psqlodbc\info30.c(51): error C2223: left of '->drivers'
must point to struct/union
d:\joel\wazagua_src\psqlodbc\info30.c(58): error C2223: left of '->drivers'
must point to struct/union
d:\joel\wazagua_src\psqlodbc\info30.c(69): error C2223: left of
'->updatable_cursors' must point to struct/union
d:\joel\wazagua_src\psqlodbc\info30.c(69): error C2223: left of '->drivers'
must point to struct/union
d:\joel\wazagua_src\psqlodbc\info30.c(77): error C2223: left of '->drivers'
must point to struct/union
d:\joel\wazagua_src\psqlodbc\info30.c(98): error C2223: left of
'->updatable_cursors' must point to struct/union
d:\joel\wazagua_src\psqlodbc\info30.c(109): error C2223: left of
'->updatable_cursors' must point to struct/union
d:\joel\wazagua_src\psqlodbc\info30.c(121): error C2223: left of '->drivers'
must point to struct/union
d:\joel\wazagua_src\psqlodbc\info30.c(150): warning C4013: 'PG_VERSION_LE'
undefined; assuming extern returning int
d:\joel\wazagua_src\psqlodbc\info30.c(151): error C2065: 'p' : undeclared
identifier
d:\joel\wazagua_src\psqlodbc\info30.c(151): warning C4047: '=' : 'int'
differs in levels of indirection from 'char [2]'
d:\joel\wazagua_src\psqlodbc\info30.c(153): warning C4047: '=' : 'int'
differs in levels of indirection from 'char [2]'
d:\joel\wazagua_src\psqlodbc\info30.c(157): warning C4047: '=' : 'int'
differs in levels of indirection from 'char [1]'
d:\joel\wazagua_src\psqlodbc\info30.c(177): error C2037: left of
'schema_support' specifies undefined struct/union 'ConnectionClass_'
d:\joel\wazagua_src\psqlodbc\info30.c(186): warning C4013: 'PG_VERSION_GE'
undefined; assuming extern returning int
d:\joel\wazagua_src\psqlodbc\info30.c(209): warning C4047: '=' : 'int'
differs in levels of indirection from 'char [2]'
d:\joel\wazagua_src\psqlodbc\info30.c(229): error C2037: left of
'schema_support' specifies undefined struct/union 'ConnectionClass_'
d:\joel\wazagua_src\psqlodbc\info30.c(237): warning C4013: 'PG_VERSION_GT'
undefined; assuming extern returning int
d:\joel\wazagua_src\psqlodbc\info30.c(270): warning C4047: '=' : 'int'
differs in levels of indirection from 'char [2]'
d:\joel\wazagua_src\psqlodbc\info30.c(357): warning C4013: 'CC_set_error'
undefined; assuming extern returning int
d:\joel\wazagua_src\psqlodbc\info30.c(357): error C2065:
'CONN_NOT_IMPLEMENTED_ERROR' : undeclared identifier
d:\joel\wazagua_src\psqlodbc\info30.c(358): warning C4013: 'CC_log_error'
undefined; assuming extern returning int
d:\joel\wazagua_src\psqlodbc\info30.c(366): warning C4047: 'function' :
'const char *' differs in levels of indirection from 'int'
d:\joel\wazagua_src\psqlodbc\info30.c(373): error C2037: left of 'unicode'
specifies undefined struct/union 'ConnectionClass_'
d:\joel\wazagua_src\psqlodbc\info30.c(379): error C2037: left of 'unicode'
specifies undefined struct/union 'ConnectionClass_'
d:\joel\wazagua_src\psqlodbc\info30.c(380): warning C4047: 'function' :
'const char *' differs in levels of indirection from 'int'
d:\joel\wazagua_src\psqlodbc\info30.c(382): warning C4047: 'function' :
'const char *' differs in levels of indirection from 'int'
d:\joel\wazagua_src\psqlodbc\info30.c(387): error C2065: 'CONN_TRUNCATED' :
undeclared identifier
d:\joel\wazagua_src\psqlodbc\info30.c(406): warning C4047: ':' : 'int'
differs in levels of indirection from 'char [7]'
>
> That is the error description
> If con.Errors.Count >= 1 Then
>         set Error = con.Errors.Item(0)
>         'take the error code from SQL Server
>         ErrCode = Error.NativeError
>         response.Write(cstr(Error.Description))
>    Response.End
> End If
>
> Could be there is better method, but this what I have been using.

Dunno if there's a better method - I would be inclined to loop round
con.Errors.Count though - maybe something like:

For X = 1 To con.Errors.Count
    set Error = con.Errors.Item(X - 1)
    'take the error code from SQL Server
    ErrCode = Error.NativeError
    response.Write(cstr(Error.Description))
End If
Response.End



> I have tested putting a 300 meg text field in the data base
> nad it worked so
> not clear why it works on most data and this one does not.
> I did email you the log file (not sure it is any help).

Yeah, I can't see anything obviously wrong in it. A few things to
consider though:

- ASP seems to be retrieving data as SQL_C_CHAR, which means it's
getting raw data, not UCS2 converted from UTF8.

- ASP is retrieving data in 32KB chunks, so it would probably be worth
making sure max_long_varchar is at least that.

- Some data (quotes and such) doesn't look so good. Could it have been
pasted from MS Word or similar?

- Are you compiling the driver yourself? If so how? It seems to be using
the old comms layer, not libpq (which I'm no longer working on). The
giveaway is lines like the following which are for debugging the network
protocol:

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 15, global_socket_buffersize=8192
auth got 'R'
areq = 0
auth got 'K'
auth got 'Z'

All this is now encapsulated in libpq, which doesn't log what it's
doing.

To fix this, compile on the command line:

nmake /f win32.mak

This should ensure you get the default libpq build. If you're doing this
in an IDE, make sure USE_LIBPQ is defined!

Regards, Dave.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


pgsql-odbc by date:

Previous
From: Marko Ristola
Date:
Subject: Re: Transactions and SavePoints
Next
From: Cleber Nardelli
Date:
Subject: Re: Transactions and SavePoints