5151#include "catalog/pg_opclass.h"
5252#include "catalog/pg_proc.h"
5353#include "catalog/pg_rewrite.h"
54+ #include "catalog/pg_shseclabel.h"
5455#include "catalog/pg_tablespace.h"
5556#include "catalog/pg_trigger.h"
5657#include "catalog/pg_type.h"
@@ -98,6 +99,7 @@ static const FormData_pg_attribute Desc_pg_database[Natts_pg_database] = {Schema
9899static const FormData_pg_attribute Desc_pg_authid [Natts_pg_authid ] = {Schema_pg_authid };
99100static const FormData_pg_attribute Desc_pg_auth_members [Natts_pg_auth_members ] = {Schema_pg_auth_members };
100101static const FormData_pg_attribute Desc_pg_index [Natts_pg_index ] = {Schema_pg_index };
102+ static const FormData_pg_attribute Desc_pg_shseclabel [Natts_pg_shseclabel ] = {Schema_pg_shseclabel };
101103
102104/*
103105 * Hash tables that index the relation cache
@@ -1537,7 +1539,7 @@ LookupOpclassInfo(Oid operatorClassOid,
15371539 * catalogs.
15381540 *
15391541 * formrdesc is currently used for: pg_database, pg_authid, pg_auth_members,
1540- * pg_class, pg_attribute, pg_proc, and pg_type
1542+ * pg_shseclabel, pg_class, pg_attribute, pg_proc, and pg_type
15411543 * (see RelationCacheInitializePhase2/3).
15421544 *
15431545 * Note that these catalogs can't have constraints (except attnotnull),
@@ -3189,11 +3191,11 @@ RelationCacheInitialize(void)
31893191 *
31903192 * This is called to prepare for access to shared catalogs during startup.
31913193 * We must at least set up nailed reldescs for pg_database, pg_authid,
3192- * and pg_auth_members. Ideally we'd like to have reldescs for their
3193- * indexes, too. We attempt to load this information from the shared
3194- * relcache init file. If that's missing or broken, just make phony
3195- * entries for the catalogs themselves. RelationCacheInitializePhase3
3196- * will clean up as needed.
3194+ * pg_auth_members, and pg_shseclabel. Ideally we'd like to have reldescs
3195+ * for their indexes, too. We attempt to load this information from the
3196+ * shared relcache init file. If that's missing or broken, just make
3197+ * phony entries for the catalogs themselves.
3198+ * RelationCacheInitializePhase3 will clean up as needed.
31973199 */
31983200void
31993201RelationCacheInitializePhase2 (void )
@@ -3229,8 +3231,10 @@ RelationCacheInitializePhase2(void)
32293231 true, Natts_pg_authid , Desc_pg_authid );
32303232 formrdesc ("pg_auth_members" , AuthMemRelation_Rowtype_Id , true,
32313233 false, Natts_pg_auth_members , Desc_pg_auth_members );
3234+ formrdesc ("pg_shseclabel" , SharedSecLabelRelation_Rowtype_Id , true,
3235+ false, Natts_pg_shseclabel , Desc_pg_shseclabel );
32323236
3233- #define NUM_CRITICAL_SHARED_RELS 3 /* fix if you change list above */
3237+ #define NUM_CRITICAL_SHARED_RELS 4 /* fix if you change list above */
32343238 }
32353239
32363240 MemoryContextSwitchTo (oldcxt );
@@ -3351,7 +3355,9 @@ RelationCacheInitializePhase3(void)
33513355 * non-shared catalogs at all. Autovacuum calls InitPostgres with a
33523356 * database OID, so it instead depends on DatabaseOidIndexId. We also
33533357 * need to nail up some indexes on pg_authid and pg_auth_members for use
3354- * during client authentication.
3358+ * during client authentication. SharedSecLabelObjectIndexId isn't
3359+ * critical for the core system, but authentication hooks might be
3360+ * interested in it.
33553361 */
33563362 if (!criticalSharedRelcachesBuilt )
33573363 {
@@ -3365,8 +3371,10 @@ RelationCacheInitializePhase3(void)
33653371 AuthIdRelationId );
33663372 load_critical_index (AuthMemMemRoleIndexId ,
33673373 AuthMemRelationId );
3374+ load_critical_index (SharedSecLabelObjectIndexId ,
3375+ SharedSecLabelRelationId );
33683376
3369- #define NUM_CRITICAL_SHARED_INDEXES 5 /* fix if you change list above */
3377+ #define NUM_CRITICAL_SHARED_INDEXES 6 /* fix if you change list above */
33703378
33713379 criticalSharedRelcachesBuilt = true;
33723380 }
0 commit comments