On Tue, Jun 14, 2022 at 1:32 PM Peter Geoghegan <p...@bowt.ie> wrote: > On Tue, Jun 14, 2022 at 1:22 PM Robert Haas <robertmh...@gmail.com> wrote: > > I still am not clear on precisely what you are proposing here. I do > > agree that there is significant bit space available in pd_flags and > > that consuming some of it wouldn't be stupid, but that doesn't add up > > to a proposal. Maybe the proposal is: figure out how many different > > configurations there are for this new kind of page space, let's say N, > > and then reserve ceil(log2(N)) bits from pd_flags to indicate which > > one we've got. > > I'm just making a general point. Why wouldn't we start out with the > assumption that we use some pd_flags bit space for this stuff?
Technically we don't already do that today, with the 16-bit checksums that are stored in PageHeaderData.pd_checksum. But we do something equivalent: low-level tools can still infer that checksums must not be enabled on the page (really the cluster) indirectly in the event of a 0 checksum. A 0 value can reasonably be interpreted as a page from a cluster without checksums (barring page corruption). This is basically reasonable because our implementation of checksums is guaranteed to not generate 0 as a valid checksum value. While pg_filedump does not rely on the 0 checksum convention currently, it doesn't really need to. When the user uses the -k option to verify checksums in passing, pg_filedump can assume that checksums must be enabled ("the user said they must be so expect it" is a reasonable assumption at that point). This also depends on there being only one approach to checksums. -- Peter Geoghegan