problem with add

From: "lists" <lists(at)insyde(dot)com(dot)br>
To: <pgsql-odbc(at)postgresql(dot)org>
Subject: problem with add
Date: 2003-04-01 14:50:20
Message-ID: 01a601c2f85e$08c15f20$84faabc8@insyde
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

(this is a long post, sorry, but I have to explain the history)

Hi,

I've posted this some time ago, but I received an answer
that do not satisfy me, and possibly others.

What I'm trying to do is:

I have a taable, say TBL1 built like this:

CREATE TABLE TBL1 ( A INT,
B CHAR(4),
C CHAR(3) );
ALTER TABLE TBL1 ADD PRIMARY KEY ( A, B);

Then I add some values to it, via ODBC

INSERT INTO TBL1 (A,B,C) VALUES (1,'aaaa', 'bbb');
INSERT INTO TBL1 (A,B,C) VALUES (2,'aaaa', 'bbb');
INSERT INTO TBL1 (A,B,C) VALUES (3,'aaaa', 'bbb');
INSERT INTO TBL1 (A,B,C) VALUES (4,'aaaa', 'bbb');
INSERT INTO TBL1 (A,B,C) VALUES (5,'aaaa', 'bbb');

It's ok so far.

But a new user of the system tries to insert a value that
already exists:

INSERT INTO TBL1 (A,B,C) VALUES (4,'aaaa', 'ccc');

then the program crashes!

You can say that I didn't treated the error, but I did treat the error,
but the error code I was expecting (23000 - duplicated primary key)
didn't came back. Instead an error message from the SGBD came.

Is there any chance this would be corrected? Anyone else had the same
problem/experience? Any work-around?

If I know more programming, I would correct this, but I can't program.

TIA,
Ricardo.

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Jeff Silberberg 2003-04-01 17:44:34 Re: problem after upgrade ---
Previous Message Markus Wagner 2003-04-01 12:34:36 Re: row-level locking