mirror of
https://github.com/postgres/postgres.git
synced 2025-07-09 22:41:56 +03:00
Extend object-access hook machinery to support post-alter events.
This also slightly widens the scope of what we support in terms of post-create events. KaiGai Kohei, with a few changes, mostly to the comments, by me
This commit is contained in:
@ -241,6 +241,9 @@ AlterForeignDataWrapperOwner_internal(Relation rel, HeapTuple tup, Oid newOwnerI
|
||||
HeapTupleGetOid(tup),
|
||||
newOwnerId);
|
||||
}
|
||||
|
||||
InvokeObjectPostAlterHook(ForeignDataWrapperRelationId,
|
||||
HeapTupleGetOid(tup), 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -349,6 +352,9 @@ AlterForeignServerOwner_internal(Relation rel, HeapTuple tup, Oid newOwnerId)
|
||||
changeDependencyOnOwner(ForeignServerRelationId, HeapTupleGetOid(tup),
|
||||
newOwnerId);
|
||||
}
|
||||
|
||||
InvokeObjectPostAlterHook(ForeignServerRelationId,
|
||||
HeapTupleGetOid(tup), 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -764,6 +770,8 @@ AlterForeignDataWrapper(AlterFdwStmt *stmt)
|
||||
}
|
||||
}
|
||||
|
||||
InvokeObjectPostAlterHook(ForeignDataWrapperRelationId, fdwId, 0);
|
||||
|
||||
heap_close(rel, RowExclusiveLock);
|
||||
|
||||
return fdwId;
|
||||
@ -994,6 +1002,8 @@ AlterForeignServer(AlterForeignServerStmt *stmt)
|
||||
simple_heap_update(rel, &tp->t_self, tp);
|
||||
CatalogUpdateIndexes(rel, tp);
|
||||
|
||||
InvokeObjectPostAlterHook(ForeignServerRelationId, srvId, 0);
|
||||
|
||||
heap_freetuple(tp);
|
||||
|
||||
heap_close(rel, RowExclusiveLock);
|
||||
|
Reference in New Issue
Block a user