pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feederror 23000 is not treated in psqlODBC
2+ messages / 2 participants
[nested] [flat]
* error 23000 is not treated in psqlODBC
@ 2003-02-10 17:33 Support <support@insyde.com.br>
0 siblings, 1 reply; 2+ messages in thread
From: Support @ 2003-02-10 17:33 UTC (permalink / raw)
To: pgsql-odbc
"For example. you could have MS SQL Server and PostgreSQL servers
that have exactly the same data. Using ODBC, your Windows application
would make exactly the same calls and the back-end data source would
look the same (to the Windows application)." - PostgreSQL 7.2
Documentation - chap. 7. ODBC Interface
This should happen when I use my system. It works with MySQL and MS SQL
Server, so it would work with PostgreSQL also, without any change. The
problem I found is that psqlODBC do not validate all the error codes
specified by ODBC. The error I related should return "23000/S1010" acording
to ODBC.
Seeking psqlODBC sources, I found some of this informations/errors were
treated at environ.c, under a 'case' where most of the psqlODBC errors were
treated. Following this logic, this is where I should insert my code:
case ER_DUP_KEY:
pg_sqlstate_set(env, szSqlState, "23000", "S1010");
// key already exists
break;
This would return the error code I need to treat qhe the user tries to
insert a duplicated key.
But there is also another file where some other errors are defined
(statement.h)
where I should put:
#define ER_DUP_KEY 35 //35 is a sequence where all error that need to be
treated
//have (just add 1 to the sequence).
I found that info.c and statement.c also treat som errors, maybe I have to
code
something here?
Can anyone help me? I have also a program to test the error. If anyone
wants...
TIA,
Ricardo.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: error 23000 is not treated in psqlODBC
@ 2003-02-11 00:29 Hiroshi Inoue <Inoue@tpf.co.jp>
parent: Support <support@insyde.com.br>
0 siblings, 0 replies; 2+ messages in thread
From: Hiroshi Inoue @ 2003-02-11 00:29 UTC (permalink / raw)
To: Support <support@insyde.com.br>; +Cc: pgsql-odbc
Support wrote:
>
> "For example. you could have MS SQL Server and PostgreSQL servers
> that have exactly the same data. Using ODBC, your Windows application
> would make exactly the same calls and the back-end data source would
> look the same (to the Windows application)." - PostgreSQL 7.2
> Documentation - chap. 7. ODBC Interface
>
> This should happen when I use my system. It works with MySQL and MS SQL
> Server, so it would work with PostgreSQL also, without any change. The
> problem I found is that psqlODBC do not validate all the error codes
> specified by ODBC. The error I related should return "23000/S1010"
> acording to ODBC.
>
> Seeking psqlODBC sources, I found some of this informations/errors were
> treated at environ.c, under a 'case' where most of the psqlODBC errors
> were treated. Following this logic, this is where I should insert
> my code:
>
> case ER_DUP_KEY:
> pg_sqlstate_set(env, szSqlState, "23000", "S1010");
> // key already exists
> break;
>
> This would return the error code I need to treat qhe the user tries to
> insert a duplicated key.
Unfortunately PostgreSQL doesn't support error code at
backend side and it's very hard for clients to detect
error details such as *key already exists*.
There may be a way where we analyze the error message
but I won't do it.
regards,
Hiroshi Inoue
http://www.geocities.jp/inocchichichi/psqlodbc/
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2003-02-11 00:29 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-10 17:33 error 23000 is not treated in psqlODBC Support <support@insyde.com.br>
2003-02-11 00:29 ` Hiroshi Inoue <Inoue@tpf.co.jp>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox