pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: lists <lists@insyde.com.br>
To: pgsql-odbc@postgresql.org
Subject: problem with add
Date: Tue, 1 Apr 2003 11:50:20 -0300
Message-ID: <01a601c2f85e$08c15f20$84faabc8@insyde> (raw)

(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.

view thread (2+ messages)  latest in thread

Message-ID: <01a601c2f85e$08c15f20$84faabc8@insyde>
Permalink:  ../01a601c2f85e$08c15f20$84faabc8@insyde/
Also on:    postgresql.org/message-id/01a601c2f85e$08c15f20$84faabc8@insyde

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: lists@insyde.com.br
  Subject: Re: problem with add
  In-Reply-To: <01a601c2f85e$08c15f20$84faabc8@insyde>
  References: <01a601c2f85e$08c15f20$84faabc8@insyde>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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