@ -2308,9 +2308,7 @@ StoreCatalogInheritance1(Oid relationId, Oid parentOid,
tuple = heap_form_tuple ( desc , values , nulls ) ;
tuple = heap_form_tuple ( desc , values , nulls ) ;
simple_heap_insert ( inhRelation , tuple ) ;
CatalogTupleInsert ( inhRelation , tuple ) ;
CatalogUpdateIndexes ( inhRelation , tuple ) ;
heap_freetuple ( tuple ) ;
heap_freetuple ( tuple ) ;
@ -2398,10 +2396,7 @@ SetRelationHasSubclass(Oid relationId, bool relhassubclass)
if ( classtuple - > relhassubclass ! = relhassubclass )
if ( classtuple - > relhassubclass ! = relhassubclass )
{
{
classtuple - > relhassubclass = relhassubclass ;
classtuple - > relhassubclass = relhassubclass ;
simple_heap_update ( relationRelation , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( relationRelation , & tuple - > t_self , tuple ) ;
/* keep the catalog indexes up to date */
CatalogUpdateIndexes ( relationRelation , tuple ) ;
}
}
else
else
{
{
@ -2592,10 +2587,7 @@ renameatt_internal(Oid myrelid,
/* apply the update */
/* apply the update */
namestrcpy ( & ( attform - > attname ) , newattname ) ;
namestrcpy ( & ( attform - > attname ) , newattname ) ;
simple_heap_update ( attrelation , & atttup - > t_self , atttup ) ;
CatalogTupleUpdate ( attrelation , & atttup - > t_self , atttup ) ;
/* keep system catalog indexes current */
CatalogUpdateIndexes ( attrelation , atttup ) ;
InvokeObjectPostAlterHook ( RelationRelationId , myrelid , attnum ) ;
InvokeObjectPostAlterHook ( RelationRelationId , myrelid , attnum ) ;
@ -2902,10 +2894,7 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal)
*/
*/
namestrcpy ( & ( relform - > relname ) , newrelname ) ;
namestrcpy ( & ( relform - > relname ) , newrelname ) ;
simple_heap_update ( relrelation , & reltup - > t_self , reltup ) ;
CatalogTupleUpdate ( relrelation , & reltup - > t_self , reltup ) ;
/* keep the system catalog indexes current */
CatalogUpdateIndexes ( relrelation , reltup ) ;
InvokeObjectPostAlterHookArg ( RelationRelationId , myrelid , 0 ,
InvokeObjectPostAlterHookArg ( RelationRelationId , myrelid , 0 ,
InvalidOid , is_internal ) ;
InvalidOid , is_internal ) ;
@ -5097,8 +5086,7 @@ ATExecAddColumn(List **wqueue, AlteredTableInfo *tab, Relation rel,
/* Bump the existing child att's inhcount */
/* Bump the existing child att's inhcount */
childatt - > attinhcount + + ;
childatt - > attinhcount + + ;
simple_heap_update ( attrdesc , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( attrdesc , & tuple - > t_self , tuple ) ;
CatalogUpdateIndexes ( attrdesc , tuple ) ;
heap_freetuple ( tuple ) ;
heap_freetuple ( tuple ) ;
@ -5191,10 +5179,7 @@ ATExecAddColumn(List **wqueue, AlteredTableInfo *tab, Relation rel,
else
else
( ( Form_pg_class ) GETSTRUCT ( reltup ) ) - > relnatts = newattnum ;
( ( Form_pg_class ) GETSTRUCT ( reltup ) ) - > relnatts = newattnum ;
simple_heap_update ( pgclass , & reltup - > t_self , reltup ) ;
CatalogTupleUpdate ( pgclass , & reltup - > t_self , reltup ) ;
/* keep catalog indexes current */
CatalogUpdateIndexes ( pgclass , reltup ) ;
heap_freetuple ( reltup ) ;
heap_freetuple ( reltup ) ;
@ -5630,10 +5615,7 @@ ATExecDropNotNull(Relation rel, const char *colName, LOCKMODE lockmode)
{
{
( ( Form_pg_attribute ) GETSTRUCT ( tuple ) ) - > attnotnull = FALSE ;
( ( Form_pg_attribute ) GETSTRUCT ( tuple ) ) - > attnotnull = FALSE ;
simple_heap_update ( attr_rel , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( attr_rel , & tuple - > t_self , tuple ) ;
/* keep the system catalog indexes current */
CatalogUpdateIndexes ( attr_rel , tuple ) ;
ObjectAddressSubSet ( address , RelationRelationId ,
ObjectAddressSubSet ( address , RelationRelationId ,
RelationGetRelid ( rel ) , attnum ) ;
RelationGetRelid ( rel ) , attnum ) ;
@ -5708,10 +5690,7 @@ ATExecSetNotNull(AlteredTableInfo *tab, Relation rel,
{
{
( ( Form_pg_attribute ) GETSTRUCT ( tuple ) ) - > attnotnull = TRUE ;
( ( Form_pg_attribute ) GETSTRUCT ( tuple ) ) - > attnotnull = TRUE ;
simple_heap_update ( attr_rel , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( attr_rel , & tuple - > t_self , tuple ) ;
/* keep the system catalog indexes current */
CatalogUpdateIndexes ( attr_rel , tuple ) ;
/* Tell Phase 3 it needs to test the constraint */
/* Tell Phase 3 it needs to test the constraint */
tab - > new_notnull = true ;
tab - > new_notnull = true ;
@ -5876,10 +5855,7 @@ ATExecSetStatistics(Relation rel, const char *colName, Node *newValue, LOCKMODE
attrtuple - > attstattarget = newtarget ;
attrtuple - > attstattarget = newtarget ;
simple_heap_update ( attrelation , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( attrelation , & tuple - > t_self , tuple ) ;
/* keep system catalog indexes current */
CatalogUpdateIndexes ( attrelation , tuple ) ;
InvokeObjectPostAlterHook ( RelationRelationId ,
InvokeObjectPostAlterHook ( RelationRelationId ,
RelationGetRelid ( rel ) ,
RelationGetRelid ( rel ) ,
@ -5952,8 +5928,7 @@ ATExecSetOptions(Relation rel, const char *colName, Node *options,
repl_val , repl_null , repl_repl ) ;
repl_val , repl_null , repl_repl ) ;
/* Update system catalog. */
/* Update system catalog. */
simple_heap_update ( attrelation , & newtuple - > t_self , newtuple ) ;
CatalogTupleUpdate ( attrelation , & newtuple - > t_self , newtuple ) ;
CatalogUpdateIndexes ( attrelation , newtuple ) ;
InvokeObjectPostAlterHook ( RelationRelationId ,
InvokeObjectPostAlterHook ( RelationRelationId ,
RelationGetRelid ( rel ) ,
RelationGetRelid ( rel ) ,
@ -6036,10 +6011,7 @@ ATExecSetStorage(Relation rel, const char *colName, Node *newValue, LOCKMODE loc
errmsg ( " column data type %s can only have storage PLAIN " ,
errmsg ( " column data type %s can only have storage PLAIN " ,
format_type_be ( attrtuple - > atttypid ) ) ) ) ;
format_type_be ( attrtuple - > atttypid ) ) ) ) ;
simple_heap_update ( attrelation , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( attrelation , & tuple - > t_self , tuple ) ;
/* keep system catalog indexes current */
CatalogUpdateIndexes ( attrelation , tuple ) ;
InvokeObjectPostAlterHook ( RelationRelationId ,
InvokeObjectPostAlterHook ( RelationRelationId ,
RelationGetRelid ( rel ) ,
RelationGetRelid ( rel ) ,
@ -6277,10 +6249,7 @@ ATExecDropColumn(List **wqueue, Relation rel, const char *colName,
/* Child column must survive my deletion */
/* Child column must survive my deletion */
childatt - > attinhcount - - ;
childatt - > attinhcount - - ;
simple_heap_update ( attr_rel , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( attr_rel , & tuple - > t_self , tuple ) ;
/* keep the system catalog indexes current */
CatalogUpdateIndexes ( attr_rel , tuple ) ;
/* Make update visible */
/* Make update visible */
CommandCounterIncrement ( ) ;
CommandCounterIncrement ( ) ;
@ -6296,10 +6265,7 @@ ATExecDropColumn(List **wqueue, Relation rel, const char *colName,
childatt - > attinhcount - - ;
childatt - > attinhcount - - ;
childatt - > attislocal = true ;
childatt - > attislocal = true ;
simple_heap_update ( attr_rel , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( attr_rel , & tuple - > t_self , tuple ) ;
/* keep the system catalog indexes current */
CatalogUpdateIndexes ( attr_rel , tuple ) ;
/* Make update visible */
/* Make update visible */
CommandCounterIncrement ( ) ;
CommandCounterIncrement ( ) ;
@ -6343,10 +6309,7 @@ ATExecDropColumn(List **wqueue, Relation rel, const char *colName,
tuple_class = ( Form_pg_class ) GETSTRUCT ( tuple ) ;
tuple_class = ( Form_pg_class ) GETSTRUCT ( tuple ) ;
tuple_class - > relhasoids = false ;
tuple_class - > relhasoids = false ;
simple_heap_update ( class_rel , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( class_rel , & tuple - > t_self , tuple ) ;
/* Keep the catalog indexes up to date */
CatalogUpdateIndexes ( class_rel , tuple ) ;
heap_close ( class_rel , RowExclusiveLock ) ;
heap_close ( class_rel , RowExclusiveLock ) ;
@ -7195,8 +7158,7 @@ ATExecAlterConstraint(Relation rel, AlterTableCmd *cmd,
copy_con = ( Form_pg_constraint ) GETSTRUCT ( copyTuple ) ;
copy_con = ( Form_pg_constraint ) GETSTRUCT ( copyTuple ) ;
copy_con - > condeferrable = cmdcon - > deferrable ;
copy_con - > condeferrable = cmdcon - > deferrable ;
copy_con - > condeferred = cmdcon - > initdeferred ;
copy_con - > condeferred = cmdcon - > initdeferred ;
simple_heap_update ( conrel , & copyTuple - > t_self , copyTuple ) ;
CatalogTupleUpdate ( conrel , & copyTuple - > t_self , copyTuple ) ;
CatalogUpdateIndexes ( conrel , copyTuple ) ;
InvokeObjectPostAlterHook ( ConstraintRelationId ,
InvokeObjectPostAlterHook ( ConstraintRelationId ,
HeapTupleGetOid ( contuple ) , 0 ) ;
HeapTupleGetOid ( contuple ) , 0 ) ;
@ -7249,8 +7211,7 @@ ATExecAlterConstraint(Relation rel, AlterTableCmd *cmd,
copy_tg - > tgdeferrable = cmdcon - > deferrable ;
copy_tg - > tgdeferrable = cmdcon - > deferrable ;
copy_tg - > tginitdeferred = cmdcon - > initdeferred ;
copy_tg - > tginitdeferred = cmdcon - > initdeferred ;
simple_heap_update ( tgrel , & copyTuple - > t_self , copyTuple ) ;
CatalogTupleUpdate ( tgrel , & copyTuple - > t_self , copyTuple ) ;
CatalogUpdateIndexes ( tgrel , copyTuple ) ;
InvokeObjectPostAlterHook ( TriggerRelationId ,
InvokeObjectPostAlterHook ( TriggerRelationId ,
HeapTupleGetOid ( tgtuple ) , 0 ) ;
HeapTupleGetOid ( tgtuple ) , 0 ) ;
@ -7436,8 +7397,7 @@ ATExecValidateConstraint(Relation rel, char *constrName, bool recurse,
copyTuple = heap_copytuple ( tuple ) ;
copyTuple = heap_copytuple ( tuple ) ;
copy_con = ( Form_pg_constraint ) GETSTRUCT ( copyTuple ) ;
copy_con = ( Form_pg_constraint ) GETSTRUCT ( copyTuple ) ;
copy_con - > convalidated = true ;
copy_con - > convalidated = true ;
simple_heap_update ( conrel , & copyTuple - > t_self , copyTuple ) ;
CatalogTupleUpdate ( conrel , & copyTuple - > t_self , copyTuple ) ;
CatalogUpdateIndexes ( conrel , copyTuple ) ;
InvokeObjectPostAlterHook ( ConstraintRelationId ,
InvokeObjectPostAlterHook ( ConstraintRelationId ,
HeapTupleGetOid ( tuple ) , 0 ) ;
HeapTupleGetOid ( tuple ) , 0 ) ;
@ -8339,8 +8299,7 @@ ATExecDropConstraint(Relation rel, const char *constrName,
{
{
/* Child constraint must survive my deletion */
/* Child constraint must survive my deletion */
con - > coninhcount - - ;
con - > coninhcount - - ;
simple_heap_update ( conrel , & copy_tuple - > t_self , copy_tuple ) ;
CatalogTupleUpdate ( conrel , & copy_tuple - > t_self , copy_tuple ) ;
CatalogUpdateIndexes ( conrel , copy_tuple ) ;
/* Make update visible */
/* Make update visible */
CommandCounterIncrement ( ) ;
CommandCounterIncrement ( ) ;
@ -8356,8 +8315,7 @@ ATExecDropConstraint(Relation rel, const char *constrName,
con - > coninhcount - - ;
con - > coninhcount - - ;
con - > conislocal = true ;
con - > conislocal = true ;
simple_heap_update ( conrel , & copy_tuple - > t_self , copy_tuple ) ;
CatalogTupleUpdate ( conrel , & copy_tuple - > t_self , copy_tuple ) ;
CatalogUpdateIndexes ( conrel , copy_tuple ) ;
/* Make update visible */
/* Make update visible */
CommandCounterIncrement ( ) ;
CommandCounterIncrement ( ) ;
@ -9003,10 +8961,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
ReleaseSysCache ( typeTuple ) ;
ReleaseSysCache ( typeTuple ) ;
simple_heap_update ( attrelation , & heapTup - > t_self , heapTup ) ;
CatalogTupleUpdate ( attrelation , & heapTup - > t_self , heapTup ) ;
/* keep system catalog indexes current */
CatalogUpdateIndexes ( attrelation , heapTup ) ;
heap_close ( attrelation , RowExclusiveLock ) ;
heap_close ( attrelation , RowExclusiveLock ) ;
@ -9144,8 +9099,7 @@ ATExecAlterColumnGenericOptions(Relation rel,
newtuple = heap_modify_tuple ( tuple , RelationGetDescr ( attrel ) ,
newtuple = heap_modify_tuple ( tuple , RelationGetDescr ( attrel ) ,
repl_val , repl_null , repl_repl ) ;
repl_val , repl_null , repl_repl ) ;
simple_heap_update ( attrel , & newtuple - > t_self , newtuple ) ;
CatalogTupleUpdate ( attrel , & newtuple - > t_self , newtuple ) ;
CatalogUpdateIndexes ( attrel , newtuple ) ;
InvokeObjectPostAlterHook ( RelationRelationId ,
InvokeObjectPostAlterHook ( RelationRelationId ,
RelationGetRelid ( rel ) ,
RelationGetRelid ( rel ) ,
@ -9661,8 +9615,7 @@ ATExecChangeOwner(Oid relationOid, Oid newOwnerId, bool recursing, LOCKMODE lock
newtuple = heap_modify_tuple ( tuple , RelationGetDescr ( class_rel ) , repl_val , repl_null , repl_repl ) ;
newtuple = heap_modify_tuple ( tuple , RelationGetDescr ( class_rel ) , repl_val , repl_null , repl_repl ) ;
simple_heap_update ( class_rel , & newtuple - > t_self , newtuple ) ;
CatalogTupleUpdate ( class_rel , & newtuple - > t_self , newtuple ) ;
CatalogUpdateIndexes ( class_rel , newtuple ) ;
heap_freetuple ( newtuple ) ;
heap_freetuple ( newtuple ) ;
@ -9789,8 +9742,7 @@ change_owner_fix_column_acls(Oid relationOid, Oid oldOwnerId, Oid newOwnerId)
RelationGetDescr ( attRelation ) ,
RelationGetDescr ( attRelation ) ,
repl_val , repl_null , repl_repl ) ;
repl_val , repl_null , repl_repl ) ;
simple_heap_update ( attRelation , & newtuple - > t_self , newtuple ) ;
CatalogTupleUpdate ( attRelation , & newtuple - > t_self , newtuple ) ;
CatalogUpdateIndexes ( attRelation , newtuple ) ;
heap_freetuple ( newtuple ) ;
heap_freetuple ( newtuple ) ;
}
}
@ -10067,9 +10019,7 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation,
newtuple = heap_modify_tuple ( tuple , RelationGetDescr ( pgclass ) ,
newtuple = heap_modify_tuple ( tuple , RelationGetDescr ( pgclass ) ,
repl_val , repl_null , repl_repl ) ;
repl_val , repl_null , repl_repl ) ;
simple_heap_update ( pgclass , & newtuple - > t_self , newtuple ) ;
CatalogTupleUpdate ( pgclass , & newtuple - > t_self , newtuple ) ;
CatalogUpdateIndexes ( pgclass , newtuple ) ;
InvokeObjectPostAlterHook ( RelationRelationId , RelationGetRelid ( rel ) , 0 ) ;
InvokeObjectPostAlterHook ( RelationRelationId , RelationGetRelid ( rel ) , 0 ) ;
@ -10126,9 +10076,7 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation,
newtuple = heap_modify_tuple ( tuple , RelationGetDescr ( pgclass ) ,
newtuple = heap_modify_tuple ( tuple , RelationGetDescr ( pgclass ) ,
repl_val , repl_null , repl_repl ) ;
repl_val , repl_null , repl_repl ) ;
simple_heap_update ( pgclass , & newtuple - > t_self , newtuple ) ;
CatalogTupleUpdate ( pgclass , & newtuple - > t_self , newtuple ) ;
CatalogUpdateIndexes ( pgclass , newtuple ) ;
InvokeObjectPostAlterHookArg ( RelationRelationId ,
InvokeObjectPostAlterHookArg ( RelationRelationId ,
RelationGetRelid ( toastrel ) , 0 ,
RelationGetRelid ( toastrel ) , 0 ,
@ -10289,8 +10237,7 @@ ATExecSetTableSpace(Oid tableOid, Oid newTableSpace, LOCKMODE lockmode)
/* update the pg_class row */
/* update the pg_class row */
rd_rel - > reltablespace = ( newTableSpace = = MyDatabaseTableSpace ) ? InvalidOid : newTableSpace ;
rd_rel - > reltablespace = ( newTableSpace = = MyDatabaseTableSpace ) ? InvalidOid : newTableSpace ;
rd_rel - > relfilenode = newrelfilenode ;
rd_rel - > relfilenode = newrelfilenode ;
simple_heap_update ( pg_class , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( pg_class , & tuple - > t_self , tuple ) ;
CatalogUpdateIndexes ( pg_class , tuple ) ;
InvokeObjectPostAlterHook ( RelationRelationId , RelationGetRelid ( rel ) , 0 ) ;
InvokeObjectPostAlterHook ( RelationRelationId , RelationGetRelid ( rel ) , 0 ) ;
@ -10940,8 +10887,7 @@ MergeAttributesIntoExisting(Relation child_rel, Relation parent_rel)
childatt - > attislocal = false ;
childatt - > attislocal = false ;
}
}
simple_heap_update ( attrrel , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( attrrel , & tuple - > t_self , tuple ) ;
CatalogUpdateIndexes ( attrrel , tuple ) ;
heap_freetuple ( tuple ) ;
heap_freetuple ( tuple ) ;
}
}
else
else
@ -10980,8 +10926,7 @@ MergeAttributesIntoExisting(Relation child_rel, Relation parent_rel)
childatt - > attislocal = false ;
childatt - > attislocal = false ;
}
}
simple_heap_update ( attrrel , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( attrrel , & tuple - > t_self , tuple ) ;
CatalogUpdateIndexes ( attrrel , tuple ) ;
heap_freetuple ( tuple ) ;
heap_freetuple ( tuple ) ;
}
}
else
else
@ -11118,8 +11063,7 @@ MergeConstraintsIntoExisting(Relation child_rel, Relation parent_rel)
child_con - > conislocal = false ;
child_con - > conislocal = false ;
}
}
simple_heap_update ( catalog_relation , & child_copy - > t_self , child_copy ) ;
CatalogTupleUpdate ( catalog_relation , & child_copy - > t_self , child_copy ) ;
CatalogUpdateIndexes ( catalog_relation , child_copy ) ;
heap_freetuple ( child_copy ) ;
heap_freetuple ( child_copy ) ;
found = true ;
found = true ;
@ -11289,8 +11233,7 @@ RemoveInheritance(Relation child_rel, Relation parent_rel)
if ( copy_att - > attinhcount = = 0 )
if ( copy_att - > attinhcount = = 0 )
copy_att - > attislocal = true ;
copy_att - > attislocal = true ;
simple_heap_update ( catalogRelation , & copyTuple - > t_self , copyTuple ) ;
CatalogTupleUpdate ( catalogRelation , & copyTuple - > t_self , copyTuple ) ;
CatalogUpdateIndexes ( catalogRelation , copyTuple ) ;
heap_freetuple ( copyTuple ) ;
heap_freetuple ( copyTuple ) ;
}
}
}
}
@ -11364,8 +11307,7 @@ RemoveInheritance(Relation child_rel, Relation parent_rel)
if ( copy_con - > coninhcount = = 0 )
if ( copy_con - > coninhcount = = 0 )
copy_con - > conislocal = true ;
copy_con - > conislocal = true ;
simple_heap_update ( catalogRelation , & copyTuple - > t_self , copyTuple ) ;
CatalogTupleUpdate ( catalogRelation , & copyTuple - > t_self , copyTuple ) ;
CatalogUpdateIndexes ( catalogRelation , copyTuple ) ;
heap_freetuple ( copyTuple ) ;
heap_freetuple ( copyTuple ) ;
}
}
}
}
@ -11565,8 +11507,7 @@ ATExecAddOf(Relation rel, const TypeName *ofTypename, LOCKMODE lockmode)
if ( ! HeapTupleIsValid ( classtuple ) )
if ( ! HeapTupleIsValid ( classtuple ) )
elog ( ERROR , " cache lookup failed for relation %u " , relid ) ;
elog ( ERROR , " cache lookup failed for relation %u " , relid ) ;
( ( Form_pg_class ) GETSTRUCT ( classtuple ) ) - > reloftype = typeid ;
( ( Form_pg_class ) GETSTRUCT ( classtuple ) ) - > reloftype = typeid ;
simple_heap_update ( relationRelation , & classtuple - > t_self , classtuple ) ;
CatalogTupleUpdate ( relationRelation , & classtuple - > t_self , classtuple ) ;
CatalogUpdateIndexes ( relationRelation , classtuple ) ;
InvokeObjectPostAlterHook ( RelationRelationId , relid , 0 ) ;
InvokeObjectPostAlterHook ( RelationRelationId , relid , 0 ) ;
@ -11610,8 +11551,7 @@ ATExecDropOf(Relation rel, LOCKMODE lockmode)
if ( ! HeapTupleIsValid ( tuple ) )
if ( ! HeapTupleIsValid ( tuple ) )
elog ( ERROR , " cache lookup failed for relation %u " , relid ) ;
elog ( ERROR , " cache lookup failed for relation %u " , relid ) ;
( ( Form_pg_class ) GETSTRUCT ( tuple ) ) - > reloftype = InvalidOid ;
( ( Form_pg_class ) GETSTRUCT ( tuple ) ) - > reloftype = InvalidOid ;
simple_heap_update ( relationRelation , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( relationRelation , & tuple - > t_self , tuple ) ;
CatalogUpdateIndexes ( relationRelation , tuple ) ;
InvokeObjectPostAlterHook ( RelationRelationId , relid , 0 ) ;
InvokeObjectPostAlterHook ( RelationRelationId , relid , 0 ) ;
@ -11651,8 +11591,7 @@ relation_mark_replica_identity(Relation rel, char ri_type, Oid indexOid,
if ( pg_class_form - > relreplident ! = ri_type )
if ( pg_class_form - > relreplident ! = ri_type )
{
{
pg_class_form - > relreplident = ri_type ;
pg_class_form - > relreplident = ri_type ;
simple_heap_update ( pg_class , & pg_class_tuple - > t_self , pg_class_tuple ) ;
CatalogTupleUpdate ( pg_class , & pg_class_tuple - > t_self , pg_class_tuple ) ;
CatalogUpdateIndexes ( pg_class , pg_class_tuple ) ;
}
}
heap_close ( pg_class , RowExclusiveLock ) ;
heap_close ( pg_class , RowExclusiveLock ) ;
heap_freetuple ( pg_class_tuple ) ;
heap_freetuple ( pg_class_tuple ) ;
@ -11711,8 +11650,7 @@ relation_mark_replica_identity(Relation rel, char ri_type, Oid indexOid,
if ( dirty )
if ( dirty )
{
{
simple_heap_update ( pg_index , & pg_index_tuple - > t_self , pg_index_tuple ) ;
CatalogTupleUpdate ( pg_index , & pg_index_tuple - > t_self , pg_index_tuple ) ;
CatalogUpdateIndexes ( pg_index , pg_index_tuple ) ;
InvokeObjectPostAlterHookArg ( IndexRelationId , thisIndexOid , 0 ,
InvokeObjectPostAlterHookArg ( IndexRelationId , thisIndexOid , 0 ,
InvalidOid , is_internal ) ;
InvalidOid , is_internal ) ;
}
}
@ -11861,10 +11799,7 @@ ATExecEnableRowSecurity(Relation rel)
elog ( ERROR , " cache lookup failed for relation %u " , relid ) ;
elog ( ERROR , " cache lookup failed for relation %u " , relid ) ;
( ( Form_pg_class ) GETSTRUCT ( tuple ) ) - > relrowsecurity = true ;
( ( Form_pg_class ) GETSTRUCT ( tuple ) ) - > relrowsecurity = true ;
simple_heap_update ( pg_class , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( pg_class , & tuple - > t_self , tuple ) ;
/* keep catalog indexes current */
CatalogUpdateIndexes ( pg_class , tuple ) ;
heap_close ( pg_class , RowExclusiveLock ) ;
heap_close ( pg_class , RowExclusiveLock ) ;
heap_freetuple ( tuple ) ;
heap_freetuple ( tuple ) ;
@ -11888,10 +11823,7 @@ ATExecDisableRowSecurity(Relation rel)
elog ( ERROR , " cache lookup failed for relation %u " , relid ) ;
elog ( ERROR , " cache lookup failed for relation %u " , relid ) ;
( ( Form_pg_class ) GETSTRUCT ( tuple ) ) - > relrowsecurity = false ;
( ( Form_pg_class ) GETSTRUCT ( tuple ) ) - > relrowsecurity = false ;
simple_heap_update ( pg_class , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( pg_class , & tuple - > t_self , tuple ) ;
/* keep catalog indexes current */
CatalogUpdateIndexes ( pg_class , tuple ) ;
heap_close ( pg_class , RowExclusiveLock ) ;
heap_close ( pg_class , RowExclusiveLock ) ;
heap_freetuple ( tuple ) ;
heap_freetuple ( tuple ) ;
@ -11917,10 +11849,7 @@ ATExecForceNoForceRowSecurity(Relation rel, bool force_rls)
elog ( ERROR , " cache lookup failed for relation %u " , relid ) ;
elog ( ERROR , " cache lookup failed for relation %u " , relid ) ;
( ( Form_pg_class ) GETSTRUCT ( tuple ) ) - > relforcerowsecurity = force_rls ;
( ( Form_pg_class ) GETSTRUCT ( tuple ) ) - > relforcerowsecurity = force_rls ;
simple_heap_update ( pg_class , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( pg_class , & tuple - > t_self , tuple ) ;
/* keep catalog indexes current */
CatalogUpdateIndexes ( pg_class , tuple ) ;
heap_close ( pg_class , RowExclusiveLock ) ;
heap_close ( pg_class , RowExclusiveLock ) ;
heap_freetuple ( tuple ) ;
heap_freetuple ( tuple ) ;
@ -11988,8 +11917,7 @@ ATExecGenericOptions(Relation rel, List *options)
tuple = heap_modify_tuple ( tuple , RelationGetDescr ( ftrel ) ,
tuple = heap_modify_tuple ( tuple , RelationGetDescr ( ftrel ) ,
repl_val , repl_null , repl_repl ) ;
repl_val , repl_null , repl_repl ) ;
simple_heap_update ( ftrel , & tuple - > t_self , tuple ) ;
CatalogTupleUpdate ( ftrel , & tuple - > t_self , tuple ) ;
CatalogUpdateIndexes ( ftrel , tuple ) ;
/*
/*
* Invalidate relcache so that all sessions will refresh any cached plans
* Invalidate relcache so that all sessions will refresh any cached plans
@ -12284,8 +12212,7 @@ AlterRelationNamespaceInternal(Relation classRel, Oid relOid,
/* classTup is a copy, so OK to scribble on */
/* classTup is a copy, so OK to scribble on */
classForm - > relnamespace = newNspOid ;
classForm - > relnamespace = newNspOid ;
simple_heap_update ( classRel , & classTup - > t_self , classTup ) ;
CatalogTupleUpdate ( classRel , & classTup - > t_self , classTup ) ;
CatalogUpdateIndexes ( classRel , classTup ) ;
/* Update dependency on schema if caller said so */
/* Update dependency on schema if caller said so */
if ( hasDependEntry & &
if ( hasDependEntry & &
@ -13520,8 +13447,7 @@ ATExecDetachPartition(Relation rel, RangeVar *name)
new_val , new_null , new_repl ) ;
new_val , new_null , new_repl ) ;
( ( Form_pg_class ) GETSTRUCT ( newtuple ) ) - > relispartition = false ;
( ( Form_pg_class ) GETSTRUCT ( newtuple ) ) - > relispartition = false ;
simple_heap_update ( classRel , & newtuple - > t_self , newtuple ) ;
CatalogTupleUpdate ( classRel , & newtuple - > t_self , newtuple ) ;
CatalogUpdateIndexes ( classRel , newtuple ) ;
heap_freetuple ( newtuple ) ;
heap_freetuple ( newtuple ) ;
heap_close ( classRel , RowExclusiveLock ) ;
heap_close ( classRel , RowExclusiveLock ) ;