Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4gEO-0005hY-KJ for pgsql-bugs@arkaria.postgresql.org; Sun, 10 Feb 2013 23:22:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U4gEN-00067r-SQ for pgsql-bugs@arkaria.postgresql.org; Sun, 10 Feb 2013 23:22:43 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4gEN-00067l-00 for pgsql-bugs@postgresql.org; Sun, 10 Feb 2013 23:22:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4gEL-0001MD-Tl for pgsql-bugs@postgresql.org; Sun, 10 Feb 2013 23:22:42 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r1ANMdqw015658; Sun, 10 Feb 2013 18:22:39 -0500 (EST) From: Tom Lane To: matti.aarnio@methics.fi cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7865: Unexpected error code on insert of duplicate to composite primary key In-reply-to: References: Comments: In-reply-to matti.aarnio@methics.fi message dated "Sat, 09 Feb 2013 20:25:39 +0000" Date: Sun, 10 Feb 2013 18:22:39 -0500 Message-ID: <15657.1360538559@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org matti.aarnio@methics.fi writes: > CREATE TABLE example ( > a TIMESTAMP NOT NULL, > b VARCHAR(256) NOT NULL, > c VARCHAR(256) NOT NULL, > PRIMARY KEY(a,b,c) > ); > Inserting a duplicate record on this is returning an SQL Error, but the > status code is 0 instead of expected 23505. Works for me: regression=# CREATE TABLE example ( regression(# a TIMESTAMP NOT NULL, regression(# b VARCHAR(256) NOT NULL, regression(# c VARCHAR(256) NOT NULL, regression(# PRIMARY KEY(a,b,c) regression(# ); CREATE TABLE regression=# \set VERBOSITY verbose regression=# insert into example values('today','today','foo'); INSERT 0 1 regression=# insert into example values('today','today','foo'); ERROR: 23505: duplicate key value violates unique constraint "example_pkey" DETAIL: Key (a, b, c)=(2013-02-10 00:00:00, today, foo) already exists. SCHEMA NAME: public TABLE NAME: example CONSTRAINT NAME: example_pkey LOCATION: _bt_check_unique, nbtinsert.c:398 I'm guessing you have a client-side problem, but since you've said nothing about what the client-side software is, it's hard to venture anything more detailed. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs