Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4tcD-0002Mi-DE for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Feb 2013 13:40:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U4tcC-0006pO-M1 for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Feb 2013 13:40:12 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4tcB-0006ny-0h for pgsql-bugs@postgresql.org; Mon, 11 Feb 2013 13:40:11 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4tc7-0006ii-0r for pgsql-bugs@postgresql.org; Mon, 11 Feb 2013 13:40:09 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id D63F428DE8; Mon, 11 Feb 2013 05:40:03 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (zcs-prod-ext-mta-2.vmware.com [10.113.62.224]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id D44B618761; Mon, 11 Feb 2013 05:40:03 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id 40839C1599; Mon, 11 Feb 2013 05:40:03 -0800 (PST) X-Virus-Scanned: amavisd-new at zcs-prod-ext-mta-2.vmware.com Received: from zcs-prod-ext-mta-2.vmware.com ([127.0.0.1]) by localhost (zcs-prod-ext-mta-2.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UcSguW9JbSoZ; Mon, 11 Feb 2013 05:40:03 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id 08E9EC1525; Mon, 11 Feb 2013 04:11:13 -0800 (PST) Received: from [192.168.1.90] (unknown [10.113.62.14]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTPSA; Mon, 11 Feb 2013 04:11:12 -0800 (PST) Message-ID: <5118DFDB.4080103@vmware.com> Date: Mon, 11 Feb 2013 14:11:07 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 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 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -6.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 On 09.02.2013 22:25, matti.aarnio@methics.fi wrote: > 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. > > This used to work fine in 8.x series, but is now causing trouble in 9.1.7, > and 9.2.3. Works for me: postgres=# do $$ begin insert into example values ('2001-01-01', 'foo', 'bar'); insert into example values ('2001-01-01', 'foo', 'bar'); exception when others then raise notice 'caught %', sqlstate; end; $$; NOTICE: caught 23505 DO How exactly are you seeing the wrong status code? What client are you using? - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs