pgsql: Remove special BKI_LOOKUP magic for namespace and role OIDs. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Remove special BKI_LOOKUP magic for namespace and role OIDs.
Date
Msg-id E1l7LXS-0007sJ-Nn@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Remove special BKI_LOOKUP magic for namespace and role OIDs.

Now that commit 62f34097c attached BKI_LOOKUP annotation to all the
namespace and role OID columns in the catalogs, there's no real reason
to have the magic PGNSP and PGUID symbols.  Get rid of them in favor
of implementing those lookups according to genbki.pl's normal pattern.

This means that in the catalog headers, BKI_DEFAULT(PGNSP) becomes
BKI_DEFAULT(pg_catalog), which seems a lot more transparent.
BKI_DEFAULT(PGUID) becomes BKI_DEFAULT(POSTGRES), which is perhaps
less so; but you can look into pg_authid.dat to discover that
POSTGRES is the nonce name for the bootstrap superuser.

This change also means that if we ever need cross-references in the
initial catalog data to any of the other built-in roles besides
POSTGRES, or to some other built-in schema besides pg_catalog,
we can just do it.

No catversion bump here, as there's no actual change in the contents
of postgres.bki.

Discussion: https://postgr.es/m/3240355.1612129197@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ba0faf81c65ac99dd42ce192f3257d4d2231ea50

Modified Files
--------------
doc/src/sgml/bki.sgml                | 11 -----------
src/backend/catalog/genbki.pl        | 24 ++++++++++--------------
src/include/catalog/pg_authid.dat    |  4 ++++
src/include/catalog/pg_class.h       |  4 ++--
src/include/catalog/pg_collation.h   |  9 ++++++---
src/include/catalog/pg_conversion.h  |  4 ++--
src/include/catalog/pg_database.h    |  2 +-
src/include/catalog/pg_language.h    |  2 +-
src/include/catalog/pg_namespace.h   |  2 +-
src/include/catalog/pg_opclass.h     |  4 ++--
src/include/catalog/pg_operator.h    |  4 ++--
src/include/catalog/pg_opfamily.h    |  4 ++--
src/include/catalog/pg_proc.h        |  4 ++--
src/include/catalog/pg_tablespace.h  |  4 +++-
src/include/catalog/pg_ts_config.h   |  4 ++--
src/include/catalog/pg_ts_dict.h     |  4 ++--
src/include/catalog/pg_ts_parser.h   |  2 +-
src/include/catalog/pg_ts_template.h |  2 +-
src/include/catalog/pg_type.h        |  4 ++--
19 files changed, 46 insertions(+), 52 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: pg_dump: Fix dumping of inherited generated columns
Next
From: Robert Haas
Date:
Subject: pgsql: Factor pattern-construction logic out of processSQLNamePattern.