pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedproblem on treatment when add a duplicate primary key
3+ messages / 1 participants
[nested] [flat]
* problem on treatment when add a duplicate primary key
@ 2003-02-03 13:20 Support <support@insyde.com.br>
0 siblings, 0 replies; 3+ messages in thread
From: Support @ 2003-02-03 13:20 UTC (permalink / raw)
To: pgsql-odbc
Hi,
I'm getting an error when I try to insrt a duplicated value in
a primary key or unique index.
I know I can't insert so I'll explain the thing:
When I insert the first time the row, it works
but if I try to re-insert it simply crashes my application,
giving me errors that I couldn't treat (I can treat this error in
MSSQL ODBC Driver and MySQL ODBC Driver).
I'm attaching the logs.
TIA,
Ricardo.
Attachments:
SQL.tar.bz2 (application/octet-stream, 27.9K) download
^ permalink raw reply [nested|flat] 3+ messages in thread
* problem on treatment when add a duplicate primary key
@ 2003-02-04 10:46 Support <support@insyde.com.br>
0 siblings, 0 replies; 3+ messages in thread
From: Support @ 2003-02-04 10:46 UTC (permalink / raw)
To: pgsql-odbc
Hi,
I'm getting an error when I try to insert a duplicated value in
a primary key or unique index.
I know I can't insert so I'll explain the thing:
When I insert the first time the row, it works
but if I try to re-insert it simply crashes my application,
giving me errors that I couldn't treat (I can treat this error in
MSSQL ODBC Driver and MySQL ODBC Driver).
Browsing the source I found that this was missing (please correct if wrong):
environ.c
case ERROR_DUPLICATED_ENTRY:
pg_sqlstate_set(env, szSqlState, "23000", ??????);
// entry already exists
break;
case ERROR_DUPLICATED_KEY:
pg_sqlstate_set(env, szSqlState, "23000", ???????);
// key already exists
break;
(didn't find the second code yet. What is it?)
statement.h
#define ERRROR_DUPLICATED_ENTRY 34
#define ERRROR_DUPLICATED_KEY 35
(next numbers of the sequence)
I'm still investigating, but if any of you know about it,
let me know.
I also don't know if ERRROR_DUPLICATED_ENTRY
and ERRROR_DUPLICATED_KEY are valid return codes
and where to put them. If someone can help.
TIA,
Ricardo
^ permalink raw reply [nested|flat] 3+ messages in thread
* Fw: problem on treatment when add a duplicate primary key
@ 2003-02-04 18:44 Support <support@insyde.com.br>
0 siblings, 0 replies; 3+ messages in thread
From: Support @ 2003-02-04 18:44 UTC (permalink / raw)
To: pgsql-odbc
----- Original Message -----
From: "Support" <support@insyde.com.br>
To: "Support" <support@insyde.com.br>
Sent: Tuesday, February 04, 2003 4:41 PM
Subject: Re: [ODBC] problem on treatment when add a duplicate primary key
>
> ----- Original Message -----
> From: "Support" <support@insyde.com.br>
> To: <pgsql-odbc@postgresql.org>
> Sent: Tuesday, February 04, 2003 8:46 AM
> Subject: [ODBC] problem on treatment when add a duplicate primary key
>
>
> > Hi,
> > I'm getting an error when I try to insert a duplicated value in
> > a primary key or unique index.
> > I know I can't insert so I'll explain the thing:
> >
> > When I insert the first time the row, it works
> > but if I try to re-insert it simply crashes my application,
> > giving me errors that I couldn't treat (I can treat this error in
> > MSSQL ODBC Driver and MySQL ODBC Driver).
> >
> > Browsing the source I found that this was missing (please correct if
> wrong):
> >
> > environ.c
> >
> > case ERROR_DUPLICATED_ENTRY:
> > pg_sqlstate_set(env, szSqlState, "23000", ??????);
> > // entry already exists
> > break;
> > case ERROR_DUPLICATED_KEY:
> > pg_sqlstate_set(env, szSqlState, "23000", ???????);
> > // key already exists
> > break;
> > (didn't find the second code yet. What is it?)
> > statement.h
> >
> > #define ERRROR_DUPLICATED_ENTRY 34
> > #define ERRROR_DUPLICATED_KEY 35
> > (next numbers of the sequence)
> >
> > I'm still investigating, but if any of you know about it,
> > let me know.
> >
> > I also don't know if ERRROR_DUPLICATED_ENTRY
> > and ERRROR_DUPLICATED_KEY are valid return codes
> > and where to put them. If someone can help.
> >
> > TIA,
> > Ricardo
>
> Sorry, environ.c should be:
> environ.c
>
> case ERROR_DUPLICATED_ENTRY:
> pg_sqlstate_set(szSqlState, "23000", "23000"/*(?)*/);
> // entry already exists
> break;
> case ERROR_DUPLICATED_KEY:
> pg_sqlstate_set(szSqlState, "23000", "23000"/*(?)*/);
> // key already exists
> break;
>
> without "env"
>
> Ricardo.
>
>
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2003-02-04 18:44 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-03 13:20 problem on treatment when add a duplicate primary key Support <support@insyde.com.br>
2003-02-04 10:46 problem on treatment when add a duplicate primary key Support <support@insyde.com.br>
2003-02-04 18:44 Fw: problem on treatment when add a duplicate primary key Support <support@insyde.com.br>
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