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 1gjEUp-0002bM-Ek for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Jan 2019 02:30:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gjEUn-0002EL-8H for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Jan 2019 02:30:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjEUm-0002EE-Qr for pgsql-hackers@lists.postgresql.org; Tue, 15 Jan 2019 02:30:29 +0000 Received: from mail-it1-x144.google.com ([2607:f8b0:4864:20::144]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjEUj-00040t-Cl for pgsql-hackers@postgresql.org; Tue, 15 Jan 2019 02:30:27 +0000 Received: by mail-it1-x144.google.com with SMTP id m8so521300itk.0 for ; Mon, 14 Jan 2019 18:30:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fLOTmVEoXoUnX7UtFMyMCAyzvymX3O0DwncRhXcWahw=; b=kC1sJf316v6s/ihWZDO/+ZBMXhXbGTun6GgiuMliDQaAFofzo6E2aHVxgN4FG8su2k isjDkD4qudM1IPbb9c/fD96/d6PbYBFdJn8OLoTCPx9BRxJUwiPSszjhVxUIaUWCHdrE ylcx/LoQufAT3iaMB+ZH+t6wDJIUtH4W2GoyrYd4oogMOUV4BtvlRDGpu3/cPX6/uPuZ UK5HQicZF2Nv/Cf6OnVDJRu6pO8lS5Z7bpCrUfCce665CeOU9kMAyKsHDf4A8F3HrZ/U QAvfTlOCLtDvYvPIf9HO4BI2g8vAdNtJ20z6qW2oTboiCzz7+3hRKbvJAJzHpxVTybrT eDFw== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fLOTmVEoXoUnX7UtFMyMCAyzvymX3O0DwncRhXcWahw=; b=kfpbcUhXKjKI0uWVz+ptWPJXsbGjxydC6uOoBLSnFMn6IWnOaCIvN0R8VuRjYj1rQt 5HQnsW5E6cR3VRYlROGcX/BG9Q0QSRyI3HmQj4qVCQiHzh7aeAkhFOfpENg6xngW9Qyq 26j5ozYbutX21FdlgvRdAyZTFCeo66CSQ9MwSi5ue+V45rk9tAJZRLlxE+/sVr6Jwig4 mq4gwhyCbYcnIUKb/VRfYZOAJDRCLAqTQb+UYsHD50knjsJYrVTz32lzU6xKbzOPdPIQ rl+lv9iazoR3uuHbDmP/d4niANcVeqNNa5JFpzbVKwG3Pd/TYOKKDU6YJ3Dm5VpR2kZ3 ZgqQ== X-Gm-Message-State: AJcUukevGFyjJinEoIEcBQ9W5Die7UKRvcS5KqdyWhIrVLoBsVrWwmBb xNpm1WWdYjaLEqOKHvbjqWWknQ== X-Google-Smtp-Source: ALg8bN7GQTKAxKtwOPlknhgr+zf3RaX+sDp+4KaU913Dpas0/FYiNKeko8bLIKejKorEE5lmlYaOnQ== X-Received: by 2002:a24:2716:: with SMTP id g22mr1220682ita.40.1547519424377; Mon, 14 Jan 2019 18:30:24 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id o192sm1124713itb.31.2019.01.14.18.30.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 18:30:23 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 824B2800FF9; Mon, 14 Jan 2019 20:30:22 -0600 (CST) Date: Mon, 14 Jan 2019 20:30:22 -0600 From: Justin Pryzby To: Alvaro Herrera Cc: pgsql-hackers@postgresql.org, Teodor Sigaev Subject: Re: unique, partitioned index fails to distinguish index key from INCLUDEd columns Message-ID: <20190115023022.GJ15177@telsasoft.com> References: <20190109065109.GA4285@telsasoft.com> <201901142231.tbnjmhllnptv@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901142231.tbnjmhllnptv@alvherre.pgsql> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Jan 14, 2019 at 07:31:07PM -0300, Alvaro Herrera wrote: > 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. I figured as much - I thought to test this while trying to fall asleep, without knowing they were developed in parallel. Should backpatch to v11 ? 0ad41cf537ea5f076273fcffa4c83a184bd9910f Thanks, Justin