Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZboMC-0002OB-72 for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2015 11:25:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZboMB-0007l3-OO for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2015 11:25:03 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZboMA-0007jz-CG for pgsql-hackers@postgresql.org; Tue, 15 Sep 2015 11:25:02 +0000 Received: from fr1.2ndquadrant.fr ([94.23.17.124]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZboM7-0001HP-JF for pgsql-hackers@postgresql.org; Tue, 15 Sep 2015 11:25:01 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by fr1.2ndquadrant.fr (Postfix) with ESMTP id 3B410680EF; Tue, 15 Sep 2015 13:24:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at fr1.2ndquadrant.fr Received: from fr1.2ndquadrant.fr ([127.0.0.1]) by localhost (fr1.2ndquadrant.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ntmk3ZERibtj; Tue, 15 Sep 2015 13:24:53 +0200 (CEST) Received: from [192.168.0.3] (ath91-3-88-167-161-184.fbx.proxad.net [88.167.161.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: charles) by fr1.2ndquadrant.fr (Postfix) with ESMTPSA id 34EBA680D4; Tue, 15 Sep 2015 13:24:53 +0200 (CEST) Subject: Re: [PROPOSAL] Covering + unique indexes. To: Anastasia Lubennikova , pgsql-hackers@postgresql.org References: <55F2C1BC.3010109@postgrespro.ru> <55F2CCD0.7040608@postgrespro.ru> <55F6F7AD.4080307@BlueTreble.com> <55F70D0A.2030503@sigaev.ru> <55F73FDA.2030001@BlueTreble.com> <55F7B7C9.6090109@sigaev.ru> <55F7E0AB.3020600@2ndquadrant.fr> <55F7F6D7.1060800@postgrespro.ru> From: Vik Fearing Message-ID: <55F7FFFF.6010904@2ndquadrant.fr> Date: Tue, 15 Sep 2015 13:24:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55F7F6D7.1060800@postgrespro.ru> Content-Type: text/plain; charset=utf-8 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 On 09/15/2015 12:45 PM, Anastasia Lubennikova wrote: > 15.09.2015 12:11, Vik Fearing: >> On 09/15/2015 10:57 AM, David Rowley wrote: >>>> I agree, that form >>>>> CREATE UNIQUE INDEX i ON t (f1, f2, f3) INCLUDE (f4) >>>>> is clear. f4 will be used in row compare and actually planner will >>>>> be able >>>>> to use it as unique index (f1, f2, f3) with additional f4 or as >>>>> as unique index (f1, f2, f3, f4), because uniqueness on (f1, f2, >>>>> f3) gives >>>>> warranty of uniqueness on (f1, f2, f3, f4) >>>>> >>>>> >>> I'd vote for this too. However, INCLUDE does not seem to be a >>> reserved word >>> at the moment. >> What about CREATE UNIQUE INDEX i ON t (f1, f2, f3) WITH (f4); ? > > WITH seems ambiguity to me. It refers to CTE, so I expect to see after > that a kind of query expression. But maybe that's just matter of habit. Not necessarily. See WITH ORDINALITY, for example. However, now that I've looked at it, index creation already takes a WITH clause for storage parameters, so that's out. > BTW, that's the first syntax change I'm working with. > Is there any convention in PostgreSQL about new keywords and so on? > Where can I find it? I don't think it's written anywhere except peppered throughout the archives. New keywords are greatly frowned upon. INCLUDING is already an unreserved keyword, and sounds more natural than INCLUDE anyway. Maybe that could work? -- Vik Fearing +33 6 46 75 15 36 http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers