Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZboJ0-0002KL-4V for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2015 11:21:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZboIz-0007h9-ND for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2015 11:21:45 +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 1ZboHg-0005xd-6l for pgsql-hackers@postgresql.org; Tue, 15 Sep 2015 11:20:24 +0000 Received: from hook.sigaev.ru ([93.180.27.50]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZboHc-00086w-4P for pgsql-hackers@postgresql.org; Tue, 15 Sep 2015 11:20:23 +0000 Received: from xor.sai.msu.ru (unknown [185.12.152.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: teodor) by hook.sigaev.ru (Postfix) with ESMTPSA id 54C1FB19192; Tue, 15 Sep 2015 14:20:18 +0300 (MSK) Message-ID: <55F7FEF2.7010108@sigaev.ru> Date: Tue, 15 Sep 2015 14:20:18 +0300 From: Teodor Sigaev User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1 MIME-Version: 1.0 To: Anastasia Lubennikova , pgsql-hackers@postgresql.org Subject: Re: [PROPOSAL] Covering + unique indexes. References: <55F2C1BC.3010109@postgrespro.ru> <55F2CCD0.7040608@postgrespro.ru> <55F7F0EA.2020303@postgrespro.ru> In-Reply-To: <55F7F0EA.2020303@postgrespro.ru> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Seems, final form is CREATE INDEX idx ON tbl (f1, f2, f3) [UNIQUE ON (f1, f2)] [INCLUDE (f4)] f1, f2, f3 are participated in index row comparence (btre, gist etc) f1, f2 are participated in unique constrain and it gives warranty for (f1, f2, f3[, f4]) uniqueness. Now supported by Btree only f4 doesn't participate in row comparence and could even do not have an operator class. Btree and GiST could support that. The form CREATE UNIQUE INDEX ON tbl (f1, f2, f3) is exact equivalent of form CREATE INDEX idx ON tbl (f1, f2, f3) UNIQUE ON (f1, f2, f3) I hope, that it's doible without a lot of difficulties. -- Teodor Sigaev E-mail: teodor@sigaev.ru WWW: http://www.sigaev.ru/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers