I'm unsure about switching enum to #define, could be an enum still with
explicit values set, something like:

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.

I'm fuzzy about the _OPEN_DELETED part because it is an oxymoron. Is it
RECREATE really?

No. The relevant explanation is at the top of the file:


*               -- Optionally, any number of inactive segments of size 0 blocks.
*       Inactive segments are those that once contained data but are currently
*       not needed because of an mdtruncate() operation.  The reason for leaving
*       them present at size zero, rather than unlinking them, is that other
*       backends and/or the checkpointer might be holding open file references 
*       such segments.  If the relation expands again after mdtruncate(), such
*       that a deactivated segment becomes active again, it is important that
*       such file references still be valid --- else data might get written
*       out to an unlinked old copy of a segment file that will eventually
*       disappear.


Then should it be _OPEN_INACTIVE[TED] or _OPEN_TRUNCATED rather than _OPEN_DELETED, which is contradictory?


Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to