Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axpfc-0000PS-Ho for pgsql-hackers@arkaria.postgresql.org; Wed, 04 May 2016 05:48:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1axpfc-00006H-3O for pgsql-hackers@arkaria.postgresql.org; Wed, 04 May 2016 05:48:24 +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_2) (envelope-from ) id 1axpeF-0005Xe-3b for pgsql-hackers@postgresql.org; Wed, 04 May 2016 05:46:59 +0000 Received: from jiboia.ensmp.fr ([194.214.158.137]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axpeB-0002b0-Uy for pgsql-hackers@postgresql.org; Wed, 04 May 2016 05:46:58 +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 u445kgMe007471 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 May 2016 07:46:45 +0200 Date: Wed, 4 May 2016 07:46:42 +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: <20160503234810.vzbxwxq4jincgdng@alap3.anarazel.de> Message-ID: References: <20160429235837.b63wkjw4dduf56wt@alap3.anarazel.de> <20160502164111.cpupbbkab6ik7wwd@alap3.anarazel.de> <20160502165438.yu6inlsyv4babyie@alap3.anarazel.de> <20160502203634.hmjgdumfgqrldo6n@alap3.anarazel.de> <20160502221419.shvm4vuhi4jh5hoe@alap3.anarazel.de> <20160503234810.vzbxwxq4jincgdng@alap3.anarazel.de> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at jiboia.ensmp.fr with ID 57298CC2.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: 57298CC2.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 (--) 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, >>> An enum doesn't have a benefit for a bitmask imo - you can't "legally" >>> use it as a type for functions accepting the bitmask. >> >> I do not understand. I suggested to use enum to enumerate the bitmask >> constants, ISTM that it does not preclude to use it as a bitmask as you do, >> it is just a replacement of the #define? The type constraint on the enum >> does not disallow bitmasking values, I checked with both gcc & clang. > > There's not really a point in using an enum if you use neither the type > (which you shouldn't because if you or the bitmask value you have types > outside the range of the enum), nor the autogenerated numbers. I do not think that there is such a constraint in C, you can use the enum bitfield type, so you should. You can say in the type name that it is a bitmask to make it clearer: typedef enum { EXTENSION_XXX = ...; } extension_behavior_bitfield; > Anyway seems fairly unimportant. Sure, it is just cosmetic. Now the type is already an enum and you can keep it that way, ISTM that it is cleaner to avoid defines, so I think you should. >> Then should it be _OPEN_INACTIVE[TED] or _OPEN_TRUNCATED rather than >> _OPEN_DELETED, which is contradictory? > > Well, TRUNCATED doesn't entirely work, there's I think some cases where > this currently also applies to deleted relations. I kind of like the > unintuitive sounding name, because it's really a dangerous options (any > further mdnblocks will be wrong). Hmmm. My issue is with the semantics of the name which implies how it can be understand by someone reading the code. The interface deals with files, so implicitely DELETED refers to files, and AFAICS no file was deleted. Maybe rows in the relation where deleted somehow, or entries in an index, but that has no sense at the API level. So I think you should not use DELETED. I can see why a vaguely oxymoronic name is amusing, but I do not think that it conveys any idea of "dangerous" as you suggest. Now the important think is probably not that the code is the cleanest possible one, but that it fixes the issue, so you should probably commit something. -- Fabien. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers