Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjAlJ-0004bS-Ct for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Jan 2019 22:31:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gjAlH-00010e-Rg for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Jan 2019 22:31:15 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjAlH-00010W-KV for pgsql-hackers@lists.postgresql.org; Mon, 14 Jan 2019 22:31:15 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjAlE-0002GQ-Nw for pgsql-hackers@postgresql.org; Mon, 14 Jan 2019 22:31:15 +0000 Received: by mail-qt1-x842.google.com with SMTP id v11so942415qtc.2 for ; Mon, 14 Jan 2019 14:31:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=bZ+VOCjhz5RAL4M/ig4xADfmogsTVhS27J8wOJIO/ag=; b=nAuvnF80o9BS1CZxc/MsU0wiJ+r5Tl6IMoRMdGSq0XpaQTi8RKyzLwz3TaKb17SvqU Ve086t1ipdYTPz148CIcTSYwaU3RDd8cEfEUCRE2/1dR2ebKUk7T9Rp33F6Hwiq1nU45 aF4874gMya8qO6YvR3inEqQzMPxRlfLw4to5r7eY0XyR3DcF90S5AEjiX4DNx4jhqEAB HtzJl0jv06AVmMo4IvKLQmQ3MvcROlx70CKfXKZqJw2vR0XVvZ6sZ87WGzcZQgGf9U7N 5LzSErCGbCivcwwd+s/SMmJLL3i0ZPPqs8G2/uYFY9komoBP/Jnj9INOOif5MVBP4G7E q7Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=bZ+VOCjhz5RAL4M/ig4xADfmogsTVhS27J8wOJIO/ag=; b=SGvL1L9VEbw+kke504wrpDeAoTWpQwnlKuwJwzP8QJhXsirzWkHlmdPO/MpMBdRGkX phrQIiX5RdcZY0TwZ5iFTdJx2+b4rRHjQ0n+IvMz5qccN7plMr0Tzmg7ewiZibbJ1e4S y5JlxuJ3ZGqZtBuWEfB0JwlHMmeG0M/MaJFbvDI9en8ghVlvR6HFf93bkgXketkEQD4D 8R/WT9ReulbAOjvzR8TvD9o2wZfBhAtdZGOW3EcvxX+fU27clqb+Ye2Y1uH2UzP74ncM K82SNUT0mlwfl52N+XOe/GaPuU27r4y+krI1uHi0dl8303Vob3apaGcOtKf6/NVS5jeE M1kw== X-Gm-Message-State: AJcUukezNRZE69XmJn+v01mSrQ2w71Qp0Hf14KiGf35TIibgR7w02qau b3/BK8VrjgEthw5WJtLEd52eZnz07F0BXduG8bvlfQl8fLTngInBhDoPpjcYBPKYxg2ERVlb8DP NCXKzZjJ/FklNAGqjXvRh9uRcGKMBjjLAMIq1/yf4rg2VjIfZ0rXmPJHWXl4IC+4wP2lQIKP8VU 9EjbG1TQ== X-Google-Smtp-Source: ALg8bN6dmihl1ZqiDHTHgLfAHruw2gSHDXjYy9NrtHLcBhgWZmgj0olD57mSXO4c+LJ+axGg3KVSgA== X-Received: by 2002:ac8:1909:: with SMTP id t9mr545100qtj.327.1547505070476; Mon, 14 Jan 2019 14:31:10 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id i26sm37082979qkg.12.2019.01.14.14.31.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 14:31:09 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id E7C7CC2A; Mon, 14 Jan 2019 19:31:07 -0300 (-03) Date: Mon, 14 Jan 2019 19:31:07 -0300 From: Alvaro Herrera To: Justin Pryzby Cc: pgsql-hackers@postgresql.org, Teodor Sigaev Subject: Re: unique, partitioned index fails to distinguish index key from INCLUDEd columns Message-ID: <201901142231.tbnjmhllnptv@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190109065109.GA4285@telsasoft.com> User-Agent: NeoMutt/20180716-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jan-09, Justin Pryzby wrote: > -- Fails to error > postgres=# CREATE UNIQUE INDEX ON t(j) INCLUDE(i); > > -- Fail to enforce uniqueness across partitions due to failure to enforce inclusion of partition key in index KEY > postgres=# INSERT INTO t VALUES(1,1); > postgres=# INSERT INTO t VALUES(2,1); Doh. Fix pushed. Commit 8224de4f42cc should have changed one appearance of ii_NumIndexAttrs to ii_NumIndexKeyAttrs, but because of the nature of concurrent development, nobody noticed. Thanks for reporting. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services