From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Thom Brown <thom@linux.com>
Cc: Abhijit Menon-Sen <ams@2ndquadrant.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Haribabu Kommi <kommi.haribabu@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [BUGS] Breakage with VACUUM ANALYSE + partitions
Date: Wed, 4 May 2016 07:46:42 +0200 (CEST)
Message-ID: <alpine.DEB.2.10.1605040727090.27782@sto> (raw)
In-Reply-To: <20160503234810.vzbxwxq4jincgdng@alap3.anarazel.de>
References: <20160429235837.b63wkjw4dduf56wt@alap3.anarazel.de>
<CA+TgmoZirJKnSAkjZHt8cVRW9Y7yHyWFLNENnT-LkFtBi6oBfw@mail.gmail.com>
<20160502164111.cpupbbkab6ik7wwd@alap3.anarazel.de>
<CA+Tgmoajiv-4840wHpx0o-LJ7mqSGrnCtRH8MOoJkL2A-GF2Ww@mail.gmail.com>
<20160502165438.yu6inlsyv4babyie@alap3.anarazel.de>
<alpine.DEB.2.10.1605022146390.927@sto>
<20160502203634.hmjgdumfgqrldo6n@alap3.anarazel.de>
<alpine.DEB.2.10.1605022346490.927@sto>
<20160502221419.shvm4vuhi4jh5hoe@alap3.anarazel.de>
<alpine.DEB.2.10.1605030712070.927@sto>
<20160503234810.vzbxwxq4jincgdng@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: coelho@cri.ensmp.fr, andres@anarazel.de, robertmhaas@gmail.com, thom@linux.com, ams@2ndquadrant.com, michael.paquier@gmail.com, kommi.haribabu@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [BUGS] Breakage with VACUUM ANALYSE + partitions
In-Reply-To: <alpine.DEB.2.10.1605040727090.27782@sto>
References: <20160429235837.b63wkjw4dduf56wt@alap3.anarazel.de> <CA+TgmoZirJKnSAkjZHt8cVRW9Y7yHyWFLNENnT-LkFtBi6oBfw@mail.gmail.com> <20160502164111.cpupbbkab6ik7wwd@alap3.anarazel.de> <CA+Tgmoajiv-4840wHpx0o-LJ7mqSGrnCtRH8MOoJkL2A-GF2Ww@mail.gmail.com> <20160502165438.yu6inlsyv4babyie@alap3.anarazel.de> <alpine.DEB.2.10.1605022146390.927@sto> <20160502203634.hmjgdumfgqrldo6n@alap3.anarazel.de> <alpine.DEB.2.10.1605022346490.927@sto> <20160502221419.shvm4vuhi4jh5hoe@alap3.anarazel.de> <alpine.DEB.2.10.1605030712070.927@sto> <20160503234810.vzbxwxq4jincgdng@alap3.anarazel.de> <alpine.DEB.2.10.1605040727090.27782@sto>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox