Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZSfE8-0005FX-0h for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Aug 2015 05:50:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZSfE7-0005as-GQ for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Aug 2015 05:50:55 +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 1ZSfCp-00043W-PM for pgsql-hackers@postgresql.org; Fri, 21 Aug 2015 05:49:35 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZSfCl-00045Q-PC for pgsql-hackers@postgresql.org; Fri, 21 Aug 2015 05:49:34 +0000 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id t7L5nSgq006526; Fri, 21 Aug 2015 14:49:28 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 21FF05F63F; Fri, 21 Aug 2015 14:49:28 +0900 (JST) Received: from imail3.m.ecl.ntt.co.jp (imail3.m.ecl.ntt.co.jp [129.60.5.248]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 148685F590; Fri, 21 Aug 2015 14:49:28 +0900 (JST) Received: from [127.0.0.1] ([129.60.241.61]) by imail3.m.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id t7L5nM5e023055; Fri, 21 Aug 2015 14:49:27 +0900 Subject: Re: Declarative partitioning To: David Fetter References: <55D3093C.5010800@lab.ntt.co.jp> <20150818134323.GC18054@fetter.org> <55D4309F.8030601@lab.ntt.co.jp> <20150819125239.GE11258@fetter.org> <55D5A4C0.4040900@lab.ntt.co.jp> <20150820131902.GB8691@fetter.org> Cc: Pg Hackers From: Amit Langote Message-ID: <55D6BB86.8030105@lab.ntt.co.jp> Date: Fri, 21 Aug 2015 14:47:50 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150820131902.GB8691@fetter.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Pg-Spam-Score: -3.2 (---) 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 2015-08-20 PM 10:19, David Fetter wrote: > On Thu, Aug 20, 2015 at 06:58:24PM +0900, Amit Langote wrote: >> >> Ah, I understand the point of parameterization (TRUST). Seems like it >> would be good to have with appropriate documentation of the same. Perhaps, >> it might as well a parameter to the step 1 itself. > > So TRUST would obviate step 2? Better still! > I really wish we could do this in one step, but... As you know, primary intention behind keeping step 2 separate is to do the heavy validation work with access exclusive lock on the other table instead of on the master table. Assuming we add TRUST TO step 1 (with implications clarified in docs), when/if the user does not use TRUST, the default behavior being to perform the validation, would it be OK as it would have to take the expensive lock on the master table? Motivation for keeping the step 2 (and TRUST parameter with it) is really to avoid this last concern. All that said, we'd still need some way to tell rows that came from a TRUSTed table but do not really belong to the partition because we skipped checking that at all. Obviously one can always write a query on the partition that can find them, but some form of DDL would be what people might expect. >> >> Do you mean ATTACH and DETACH, if they require access exclusive lock on >> the parent, should not be in the first cut? Or am I misreading? > > Sorry I was unclear. > > ATTACH and DETACH should be in the first cut even if they require an > access exclusive lock. > Ah, got it. Thanks, Amit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers