51
51
#include "catalog/pg_opclass.h"
52
52
#include "catalog/pg_proc.h"
53
53
#include "catalog/pg_rewrite.h"
54
+ #include "catalog/pg_shseclabel.h"
54
55
#include "catalog/pg_tablespace.h"
55
56
#include "catalog/pg_trigger.h"
56
57
#include "catalog/pg_type.h"
@@ -98,6 +99,7 @@ static const FormData_pg_attribute Desc_pg_database[Natts_pg_database] = {Schema
98
99
static const FormData_pg_attribute Desc_pg_authid [Natts_pg_authid ] = {Schema_pg_authid };
99
100
static const FormData_pg_attribute Desc_pg_auth_members [Natts_pg_auth_members ] = {Schema_pg_auth_members };
100
101
static 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 };
101
103
102
104
/*
103
105
* Hash tables that index the relation cache
@@ -1537,7 +1539,7 @@ LookupOpclassInfo(Oid operatorClassOid,
1537
1539
* catalogs.
1538
1540
*
1539
1541
* 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
1541
1543
* (see RelationCacheInitializePhase2/3).
1542
1544
*
1543
1545
* Note that these catalogs can't have constraints (except attnotnull),
@@ -3189,11 +3191,11 @@ RelationCacheInitialize(void)
3189
3191
*
3190
3192
* This is called to prepare for access to shared catalogs during startup.
3191
3193
* 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.
3197
3199
*/
3198
3200
void
3199
3201
RelationCacheInitializePhase2 (void )
@@ -3229,8 +3231,10 @@ RelationCacheInitializePhase2(void)
3229
3231
true, Natts_pg_authid , Desc_pg_authid );
3230
3232
formrdesc ("pg_auth_members" , AuthMemRelation_Rowtype_Id , true,
3231
3233
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 );
3232
3236
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 */
3234
3238
}
3235
3239
3236
3240
MemoryContextSwitchTo (oldcxt );
@@ -3351,7 +3355,9 @@ RelationCacheInitializePhase3(void)
3351
3355
* non-shared catalogs at all. Autovacuum calls InitPostgres with a
3352
3356
* database OID, so it instead depends on DatabaseOidIndexId. We also
3353
3357
* 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.
3355
3361
*/
3356
3362
if (!criticalSharedRelcachesBuilt )
3357
3363
{
@@ -3365,8 +3371,10 @@ RelationCacheInitializePhase3(void)
3365
3371
AuthIdRelationId );
3366
3372
load_critical_index (AuthMemMemRoleIndexId ,
3367
3373
AuthMemRelationId );
3374
+ load_critical_index (SharedSecLabelObjectIndexId ,
3375
+ SharedSecLabelRelationId );
3368
3376
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 */
3370
3378
3371
3379
criticalSharedRelcachesBuilt = true;
3372
3380
}
0 commit comments