Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjOdV-0008R9-Qj for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Mar 2017 11:11:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cjOdV-0006ZY-DB for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Mar 2017 11:11:05 +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_2) (envelope-from ) id 1cjOby-0002Gl-JB for pgsql-hackers@postgresql.org; Thu, 02 Mar 2017 11:09:30 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjObv-0002mr-C7 for pgsql-hackers@postgresql.org; Thu, 02 Mar 2017 11:09:29 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id C095F21C23C9; Thu, 2 Mar 2017 14:09:24 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Subject: Re: Proposal: Local indexes for partitioned table DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1488452964; bh=oSeiSPtkhWdYsPcE97E2+28xKZy5mlRs3rn9aPHgS0A=; h=To:References:Cc:From:Date:In-Reply-To; b=BUdSIsKmprIsEFnS1hg7MvIafzMJ3Wajpz6vrrkucN0hVwKMJGHNgHlSeRq/ZvKeG M1XKLTpS9O495JC5pWkwJBxIti8UAF6J3upPxCOZqFlvf7cV/W2T5NvzqDQZpSFJqn doHRNM2ngD+o9iOCB371OKKcVP/bnw82cVyXpbu8= To: Robert Haas References: Cc: Pg Hackers From: Maksim Milyutin Message-ID: Date: Thu, 2 Mar 2017 14:09:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) 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 02.03.2017 11:41, Robert Haas wrote: > Sounds generally good. One thing to keep in mind is that - in this > system - a UNIQUE index on the parent doesn't actually guarantee > uniqueness across the whole partitioning hierarchy unless it so > happens that the index columns or expressions are the same as the > partitioning columns or expressions. That's a little a > counterintuitive, and people have already been complaining that a > partitioned table + partitions doesn't look enough like a plain table. > However, I'm not sure there's a better alternative, because somebody > might want partition-wise unique indexes even though that doesn't > guarantee global uniqueness. So I think if someday we have global > indexes, then we can plan to use some other syntax for that, like > CREATE GLOBAL [ UNIQUE ] INDEX. Yes, I absolutely agree with your message that cross-partition uniqueness is guaranteed through global index on partitioned table apart from the case when the index key are the same as partitioning key (or index comprises partitioning key in general). Thanks for your comment. I'll try to propose the first patches as soon as possible. -- Maksim Milyutin Postgres Professional: http://www.postgrespro.com Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers