X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 94E3311F6709 for ; Thu, 20 Apr 2006 14:31:24 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.108 X-Spam-Level: X-Spam-Status: No, score=-2.108 required=5 tests=[AWL=0.492, BAYES_00=-2.599, SPF_PASS=-0.001] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id Ahd1LUSUre9I for ; Thu, 20 Apr 2006 14:31:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from stash.illumen.com (unknown [64.207.29.137]) by postgresql.org (Postfix) with ESMTP id 3895C11F665D for ; Thu, 20 Apr 2006 14:31:15 -0300 (ADT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Error inserting row on unique key X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Thu, 20 Apr 2006 11:31:14 -0600 Message-ID: <8511B4970E0D124898E973DF496F9B4325157D@stash.stackdump.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Error inserting row on unique key Thread-Index: AcZkoDlvEXRGSu31RTeMXtP1cjsw4Q== From: "Benjamin Krajmalnik" To: X-Archive-Number: 200604/199 X-Sequence-Number: 21368 I have a large table which uses a sequence for column which is defined = as the primary key. Our systems is a real time data acquisition system, so we have "insert" = statements going through it wrapped inside stored procedure. Every once in a while I get an inserio error on a violation of a unique = constraint on the primary key. Could this be caused by a subsequent call to the stored procedure which = took place before the sequence on the prior stored procedure fired? If so, do you recommend taking the call to the sequence out of the = columns constraint definition and manually calling it as the firs step = in the SP call? As I said, this does not happen very often, but I have seen it happen. Regards, Benjamin