Thread: [ psqlodbc-Bugs-1000738 ] Wrong ODBC state (42P01 or 42P07) is returned on dropping/creating table
[ psqlodbc-Bugs-1000738 ] Wrong ODBC state (42P01 or 42P07) is returned on dropping/creating table
From
Date:
Bugs item #1000738, was opened at 2006-09-21 14:06 You can respond by visiting: http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000738&group_id=1000125 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Dmitriy Ivanov (divanov) Assigned to: Nobody (None) Summary: Wrong ODBC state (42P01 or 42P07) is returned on dropping/creating table Initial Comment: When DROP TABLE missing_table is executed, the driver returns error state 42P01 instead of 42S02. When CREATE TABLE existing_table ... is executed, the driver returns error state 42P07 instead of 42S01. ---------------------------------------------------------------------- >Comment By: Dmitriy Ivanov (divanov) Date: 2006-12-13 10:42 Message: I see, thanks. Altering pg back-end sources is not my business :-). The mute point is whether the driver should follow the ODBC specification or adhere to values of SQL_STATE chosen by the back-end. ---------------------------------------------------------------------- Comment By: Nobody (None) Date: 2006-12-13 05:06 Message: hi,Dmitriy Ivanov the error state 42p01 is returned from backend. the ODBC is just get the error state from backend, and then show it up toclient. if you want to change this error state, you should check the file src/include/utils/errcodes.h(pg backend sources). ---------------------------------------------------------------------- Comment By: Dmitriy Ivanov (divanov) Date: 2006-09-21 21:34 Message: I am sorry for misleading. We are likely to talk about the same thing: the value of the SQL_DIAG_SQLSTATE attribute of diag record. For the 3-character subclass codes of SQLSTATE that are not specified by ISO/IEC 9075, MSDN and PosgreSQL define different values. AFAIU, the psqlODBC driver does not provide mapping for similar exception conditions. So a heterogeneous ODBC application needs to check SQLSTATE in a back-end specific manner. ---------------------------------------------------------------------- Comment By: Hiroshi Inoue (hinoue) Date: 2006-09-21 20:06 Message: I don't know about the ODBC state. Recent servers return SQLSTATE and the driver passes it the clients. regards, Hiroshi Inoue ---------------------------------------------------------------------- Comment By: Dmitriy Ivanov (divanov) Date: 2006-09-21 17:21 Message: IMHO, the ODBC state is standardized in MSDN. Do you meant that the PostgreSQL server returns (or should return) the same codes? ---------------------------------------------------------------------- Comment By: Dmitriy Ivanov (divanov) Date: 2006-09-21 17:15 Message: I meant an ODBC state, which can hardly be returned by the back-end :-) ---------------------------------------------------------------------- Comment By: Hiroshi Inoue (hinoue) Date: 2006-09-21 16:03 Message: The driver returns the error code just as it receives from the backends. regards, Hiroshi Inoue ---------------------------------------------------------------------- Comment By: Dmitriy Ivanov (divanov) Date: 2006-09-21 14:15 Message: I have forgotten to mention that the behavior is with the ANSI driver 8.02.0100 ---------------------------------------------------------------------- You can respond by visiting: http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000738&group_id=1000125