pgsql: Don't require pg_class.dat to contain correct relnatts values. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Don't require pg_class.dat to contain correct relnatts values.
Date
Msg-id E1j33aW-0001gm-Oe@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Don't require pg_class.dat to contain correct relnatts values.

Practically everybody who's ever added a column to one of the bootstrap
catalogs has been burnt by the need to update the relnatts field in the
initial pg_class data to match.  Now that we use Perl scripts to
generate postgres.bki, we can have the machines take care of that,
by filling the field during genbki.pl.

While at it, use the BKI_DEFAULTS mechanism to eliminate repetitive
specifications of other column values in pg_class.dat, too.  They
weren't particularly a maintenance problem, but this way is prettier
(certainly the spotty previous usage of BKI_DEFAULTS wasn't pretty).

No catversion bump needed, since this doesn't actually change the
contents of postgres.bki.

Per gripe from Justin Pryzby, though this is quite different from
his originally proposed solution.

Amit Langote, John Naylor, Tom Lane

Discussion: https://postgr.es/m/20200212182337.GZ1412@telsasoft.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/86ff085e83888e2e359620fc326608a674423308

Modified Files
--------------
src/backend/catalog/genbki.pl    |  9 +++++++
src/include/catalog/pg_class.dat | 46 ++++------------------------------
src/include/catalog/pg_class.h   | 53 +++++++++++++++++++++-------------------
3 files changed, 42 insertions(+), 66 deletions(-)


pgsql-committers by date:

Previous
From: Peter Geoghegan
Date:
Subject: pgsql: Recreate website's formatting for "website" doc builds.
Next
From: Tom Lane
Date:
Subject: pgsql: Clarify coding in Catalog::AddDefaultValues.