diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 114b7a707c7..fc5b9d99340 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -51,6 +51,7 @@ #include "catalog/pg_opclass.h" #include "catalog/pg_proc.h" #include "catalog/pg_rewrite.h" +#include "catalog/pg_shseclabel.h" #include "catalog/pg_tablespace.h" #include "catalog/pg_trigger.h" #include "catalog/pg_type.h" @@ -98,6 +99,7 @@ static const FormData_pg_attribute Desc_pg_database[Natts_pg_database] = {Schema static const FormData_pg_attribute Desc_pg_authid[Natts_pg_authid] = {Schema_pg_authid}; static const FormData_pg_attribute Desc_pg_auth_members[Natts_pg_auth_members] = {Schema_pg_auth_members}; static const FormData_pg_attribute Desc_pg_index[Natts_pg_index] = {Schema_pg_index}; +static const FormData_pg_attribute Desc_pg_shseclabel[Natts_pg_shseclabel] = {Schema_pg_shseclabel}; /* * Hash tables that index the relation cache @@ -1537,7 +1539,7 @@ LookupOpclassInfo(Oid operatorClassOid, * catalogs. * * formrdesc is currently used for: pg_database, pg_authid, pg_auth_members, - * pg_class, pg_attribute, pg_proc, and pg_type + * pg_shseclabel, pg_class, pg_attribute, pg_proc, and pg_type * (see RelationCacheInitializePhase2/3). * * Note that these catalogs can't have constraints (except attnotnull), @@ -3189,11 +3191,11 @@ RelationCacheInitialize(void) * * This is called to prepare for access to shared catalogs during startup. * We must at least set up nailed reldescs for pg_database, pg_authid, - * and pg_auth_members. Ideally we'd like to have reldescs for their - * indexes, too. We attempt to load this information from the shared - * relcache init file. If that's missing or broken, just make phony - * entries for the catalogs themselves. RelationCacheInitializePhase3 - * will clean up as needed. + * pg_auth_members, and pg_shseclabel. Ideally we'd like to have reldescs + * for their indexes, too. We attempt to load this information from the + * shared relcache init file. If that's missing or broken, just make + * phony entries for the catalogs themselves. + * RelationCacheInitializePhase3 will clean up as needed. */ void RelationCacheInitializePhase2(void) @@ -3229,8 +3231,10 @@ RelationCacheInitializePhase2(void) true, Natts_pg_authid, Desc_pg_authid); formrdesc("pg_auth_members", AuthMemRelation_Rowtype_Id, true, false, Natts_pg_auth_members, Desc_pg_auth_members); + formrdesc("pg_shseclabel", SharedSecLabelRelation_Rowtype_Id, true, + false, Natts_pg_shseclabel, Desc_pg_shseclabel); -#define NUM_CRITICAL_SHARED_RELS 3 /* fix if you change list above */ +#define NUM_CRITICAL_SHARED_RELS 4 /* fix if you change list above */ } MemoryContextSwitchTo(oldcxt); @@ -3351,7 +3355,9 @@ RelationCacheInitializePhase3(void) * non-shared catalogs at all. Autovacuum calls InitPostgres with a * database OID, so it instead depends on DatabaseOidIndexId. We also * need to nail up some indexes on pg_authid and pg_auth_members for use - * during client authentication. + * during client authentication. SharedSecLabelObjectIndexId isn't + * critical for the core system, but authentication hooks might be + * interested in it. */ if (!criticalSharedRelcachesBuilt) { @@ -3365,8 +3371,10 @@ RelationCacheInitializePhase3(void) AuthIdRelationId); load_critical_index(AuthMemMemRoleIndexId, AuthMemRelationId); + load_critical_index(SharedSecLabelObjectIndexId, + SharedSecLabelRelationId); -#define NUM_CRITICAL_SHARED_INDEXES 5 /* fix if you change list above */ +#define NUM_CRITICAL_SHARED_INDEXES 6 /* fix if you change list above */ criticalSharedRelcachesBuilt = true; } diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 3c3757fd35c..0e66e9286b8 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 201511071 +#define CATALOG_VERSION_NO 201601041 #endif diff --git a/src/include/catalog/pg_shseclabel.h b/src/include/catalog/pg_shseclabel.h index 03b5cee7adf..c39e11df34c 100644 --- a/src/include/catalog/pg_shseclabel.h +++ b/src/include/catalog/pg_shseclabel.h @@ -18,9 +18,10 @@ * typedef struct FormData_pg_shseclabel * ---------------- */ -#define SharedSecLabelRelationId 3592 +#define SharedSecLabelRelationId 3592 +#define SharedSecLabelRelation_Rowtype_Id 4066 -CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_WITHOUT_OIDS +CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_ROWTYPE_OID(4066) BKI_WITHOUT_OIDS BKI_SCHEMA_MACRO { Oid objoid; /* OID of the shared object itself */ Oid classoid; /* OID of table containing the shared object */ @@ -31,6 +32,8 @@ CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_WITHOUT_OIDS #endif } FormData_pg_shseclabel; +typedef FormData_pg_shseclabel *Form_pg_shseclabel; + /* ---------------- * compiler constants for pg_shseclabel * ----------------