Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aQE2v-0004Gx-0H for pgsql-admin@arkaria.postgresql.org; Mon, 01 Feb 2016 12:57:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aQE2u-0001x7-6Y for pgsql-admin@arkaria.postgresql.org; Mon, 01 Feb 2016 12:57:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aQE1F-0008WQ-CA for pgsql-admin@postgresql.org; Mon, 01 Feb 2016 12:55:49 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aQE1B-0001sC-Pp for pgsql-admin@postgresql.org; Mon, 01 Feb 2016 12:55:48 +0000 Received: by mail-wm0-x22d.google.com with SMTP id r129so69024654wmr.0 for ; Mon, 01 Feb 2016 04:55:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:reply-to:to:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; bh=hcDZ1t6igVBa6xyA583ESJO1cLGipx2pTa2LHU9TUHo=; b=J8YsKTNber9FP/54qskoxxg50E2066vjEGfupfaJmTTzn8PefyHQ2kboGYKO2shDL9 tlwmtRrdFPvKv6+P/s94JMGhEeZpf5uZoc1jDM0sTofyLZq/A+5t2aTmHGa8Drlm2UMs 4GXEcVtPwN0gfq+zJkYh/kz8MV+D1BQw17CQxfg4kCWBeGV4++V31YNlgG3KhaMbIKc1 sya8odjqF5oX9GocywzaBRqmW0ZPGTf0glbL6B7AkN66hjioCOmJXLRlFsHmlzLoATIF G+GSn2M5TSVeaFCqyOh6uBWrIBHOYMgo+pFbYR3HN+lTrg7ackMx6iVHptqil5YSIiWB pHiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:reply-to:to:date :in-reply-to:references:content-type:mime-version :content-transfer-encoding; bh=hcDZ1t6igVBa6xyA583ESJO1cLGipx2pTa2LHU9TUHo=; b=b8/F7V943Blwjf4S1T8lWvio/IAm+N6PLFlta20YR60qclA7Nu/DPtHxAkEfLT71vj fVSXLVT1n/U0J6kJJQgplmk3n2eLuc3poiBERNna8ozn25Srh3zeoxfseVB097Pl/U66 W8Cxk9dqDpWlQcLfF0R/KXrhAFldWhsqSYTmDC2N33eKPutJDMeMbUyDsCPWKS7r17/F xzec8XPHNrwA65LhUdBQTsxhU7EI9viLcwCbjpdzRBKZnXLzCXulqXUDt5629UXQwYzj bNCIdUmanKitednKiJsdbDI+a28x53YsyrOFoUHzrNiTzHGI9arAYv7WsCzXEi54HSG0 tV4Q== X-Gm-Message-State: AG10YOR82VrTFsu1ZHCkiJQ+wJL2ydl2yCq1czvWxJzNZ7SuOIDhrTfxmIkXffExTbTDvQ== X-Received: by 10.194.246.134 with SMTP id xw6mr21624246wjc.158.1454331345160; Mon, 01 Feb 2016 04:55:45 -0800 (PST) Received: from enterprisedb01 (148.Red-83-52-254.dynamicIP.rima-tde.net. [83.52.254.148]) by smtp.googlemail.com with ESMTPSA id e14sm11321701wmi.21.2016.02.01.04.55.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 01 Feb 2016 04:55:44 -0800 (PST) Message-ID: <1454331343.5847.98.camel@gmail.com> Subject: Re: Insert in table with UNIQUE index From: jaime soler Reply-To: jaime.soler@gmail.com To: Albe Laurenz , 'Artem Tomyuk *EXTERN*' , "pgsql-admin@postgresql.org" Date: Mon, 01 Feb 2016 13:55:43 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5-1ubuntu3.1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org El mié, 27-01-2016 a las 14:12 +0000, Albe Laurenz escribió: > Artem Tomyuk wrote: > > I have a table with unique index with 2 exactly the same rows. > > How it can be possible? > > > > > > CREATE TABLE _inforgchngr6716_test > > ( > > _nodetref bytea NOT NULL, > > _noderref bytea NOT NULL, > > _messageno numeric(10,0) > > ) > > WITH ( > > OIDS=FALSE > > ); > > ALTER TABLE _inforgchngr6716_test > > OWNER TO postgres; > > > > -- Index: _inforg6716_bynodemsg_rn_test > > > > -- DROP INDEX _inforg6716_bynodemsg_rn_test; > > > > CREATE UNIQUE INDEX _inforg6716_bynodemsg_rn_test > > ON _inforgchngr6716_test > > USING btree > > (_nodetref, _noderref, _messageno); > > Maybe index corruption. > Did you have any crashes? To discard a index corruption problem, try to select duplicates row setting enable_indexscan and enable_bitmapscan to false and check if you get 1 or 2 rows, if you get 2 -> I'll follow Albe advide and reindex > > Do you get an error when you > REINDEX INDEX _inforg6716_bynodemsg_rn_test; > > Yours, > Laurenz Albe > -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin