Re: Something for the TODO list: deprecating abstime and friends

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Mark Dilger <hornschnorter@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-07-19T18:56:31Z
Lists: pgsql-hackers
I wrote:
> Hm.  Currently sizeof(struct ControlFileData) = 296, at least on my
> machine.  Letting it grow past 512 would be problematic.  It's hard
> to see getting to that any time soon, though; we don't add fields
> there often.

I wonder if it'd be worth the trouble to stick something like this into
xlog.c:

	/*
	 * For reliability's sake, it's critical that pg_control updates
	 * be atomic writes.  That generally means the active data can't
	 * be more than one disk sector, which is 512 bytes on common
	 * hardware.  Be very careful about raising this limit.
	 */
	 StaticAssertStmt(sizeof(ControlFileData) <= 512,
	                  "pg_control is too large for atomic disk writes");


			regards, tom lane


Commits

  1. Add static assertions about pg_control fitting into one disk sector.

  2. doc: Remove PostgreSQL version number from xml2 deprecation notice