Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axLyT-000116-KT for pgsql-hackers@arkaria.postgresql.org; Mon, 02 May 2016 22:05:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1axLyT-0003RH-67 for pgsql-hackers@arkaria.postgresql.org; Mon, 02 May 2016 22:05:53 +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 1axLyS-0003Qe-0v for pgsql-hackers@postgresql.org; Mon, 02 May 2016 22:05:52 +0000 Received: from jiboia.ensmp.fr ([194.214.158.137]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axLyO-0000Qn-TD for pgsql-hackers@postgresql.org; Mon, 02 May 2016 22:05:50 +0000 Received: from cri.ensmp.fr (152.200.219.88.rev.sfr.net [88.219.200.152]) (authenticated bits=0) by jiboia.ensmp.fr (8.15.2/8.15.1/JMMC-22/Oct/2013) with ESMTPSA id u42M5ZAT000303 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 May 2016 00:05:36 +0200 Date: Tue, 3 May 2016 00:05:35 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@sto To: Andres Freund cc: Robert Haas , Thom Brown , Abhijit Menon-Sen , Michael Paquier , Haribabu Kommi , "pgsql-hackers@postgresql.org" Subject: Re: [BUGS] Breakage with VACUUM ANALYSE + partitions In-Reply-To: <20160502203634.hmjgdumfgqrldo6n@alap3.anarazel.de> Message-ID: References: <20160425205720.i2ldnkwj6a2ldz7g@alap3.anarazel.de> <20160426213207.j3xi2amneejm3ed6@alap3.anarazel.de> <20160429235837.b63wkjw4dduf56wt@alap3.anarazel.de> <20160502164111.cpupbbkab6ik7wwd@alap3.anarazel.de> <20160502165438.yu6inlsyv4babyie@alap3.anarazel.de> <20160502203634.hmjgdumfgqrldo6n@alap3.anarazel.de> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-Miltered: at jiboia.ensmp.fr with ID 5727CF2F.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Auth: USER-ID fabien.coelho X-j-chkmail-Enveloppe: 5727CF2F.000 from 152.200.219.88.rev.sfr.net/152.200.219.88.rev.sfr.net/88.219.200.152/cri.ensmp.fr/ X-Pg-Spam-Score: -2.9 (--) Content-ID: Content-Transfer-Encoding: 8BIT Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed 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 Hello Andres, >>> I'm not sure this is the best way to go about this. I can see valid >>> arguments for *always* using _mdfd_openseg() in mdsync(); and I'm >>> wondering whether we shouldn't make EXTENSION_* into a bitmask >>> (extend,extend_recovery,return_null,open_deleted). >> >> I thought about that when I looked at the previous fix, but it seemed that >> not all combinations made sense. > > Sure, but that's nothing unusual. Here's an attempt at doing so - not > fully polished, just as a discussion point. I think it looks better. > Fabien, Robert, what do you think? My 0,02¤. Not tested, just a few comments on the patch from someone which does not understand this API deep down... Nevertheless: I agree that it is looks better than "EXTENSION_REALLY_RETURNS_NULL", that I did not like much. There are 3 possible behaviors on extension, but coding them as bits does not make their exclusivity clear. Now mixing numbers & bits does not seem advisable either. Maybe consider checking for the exclusivity explicitely? EXTENSION_BEHAVIORS = (EXTENSION_RETURN_NULL | ..._FAIL | ..._CREATE); And then the Assert can check for the exclusivity: int behavior = option & EXTENSION_BEHAVIORS; Assert( (behavior == EXTENSION_RETURN_NULL) || (behavior == ..._FAIL) || (behavior == ..._CREATE)); I'm unsure about switching enum to #define, could be an enum still with explicit values set, something like: enum { EXTENSION_RETURN_NULL = (1 << 0), ... } extension_behavior; I'm fuzzy about the _OPEN_DELETED part because it is an oxymoron. Is it RECREATE really? -- Fabien. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers