> -----Original Message-----
> From: Hiroshi Inoue [mailto:Inoue(at)tpf(dot)co(dot)jp]
> Sent: 14 June 2001 07:27
> To: Zoltan Kovacs
> Cc: pgsql-odbc
> Subject: [ODBC] Error handling in ODBC
> Hi all,
> Recently I found the case that NOTICE causes an error in
> ODBC while examining Kristis' error report.
> It seems that NOTICE had never been the cause of SQL_ERROR
> before Zoltan's change about a year ago. Before his change
> *NOTICE* only caused a PGRES_NONFATAL_ERROR and SC_execute()
> returned SQL_SUCCESS_WITH_INFO. However currently *ERROR*
> also causes a PGRES_NONFATAL_ERROR and SC_Execute() returns
> SQL_ERROR. Why was this changed ? I'd like to put it back if
> there's no reason.
Actually this is a big problem for me (not what you are proposing, but
NOTICES in general). I'm trying to implement EXPLAIN in pgAdmin. Query Plans
are returned by the backend in a notice, which the ODBC driver happily seems
to log (if logging is switched on) and then do nothing with them (from
SOCK_get_string(sock, cmdbuffer, ERROR_MSG_LENGTH);
from backend during clear: '%s'\n", cmdbuffer);
case 'N': /* NOTICE: */
res = QR_Constructor();
QR_set_notice(res, cmdbuffer); /* will dup
this string */
mylog("~~~ NOTICE: '%s'\n", cmdbuffer);
qlog("NOTICE from backend during send_query:
As far as I can tell, it is then not possible to access the notice from a
client app (cetainly SQLError won't return it in my test prog, yet I can
quite happily get a real error from an invalid query for example.
As I said, this is a real issue for me, obviously NOTICEs probably shouldn't
raise an error that a client app might think is an actual problem, on the
other hand it would be *really* useful to be able to access them somehow.
The only way I could think of that's not completely horrendous would be to
add another info type to SQLGetInfo - say PGLastNotice.
pgsql-odbc by date
|Next:||From: Hiroshi Inoue||Date: 2001-06-14 10:08:46|
|Subject: Re: Error handling in ODBC|
|Previous:||From: Hiroshi Inoue||Date: 2001-06-14 06:51:18|
|Subject: Re: ODBC Interface version 07_01_0005, problem with C++