mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +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:
@ -19,6 +19,7 @@
|
||||
#include "catalog/dependency.h"
|
||||
#include "catalog/indexing.h"
|
||||
#include "catalog/namespace.h"
|
||||
#include "catalog/objectaccess.h"
|
||||
#include "catalog/pg_collation.h"
|
||||
#include "catalog/pg_conversion.h"
|
||||
#include "catalog/pg_event_trigger.h"
|
||||
@ -281,6 +282,8 @@ AlterObjectRename_internal(Relation rel, Oid objectId, const char *new_name)
|
||||
simple_heap_update(rel, &oldtup->t_self, newtup);
|
||||
CatalogUpdateIndexes(rel, newtup);
|
||||
|
||||
InvokeObjectPostAlterHook(classId, objectId, 0);
|
||||
|
||||
/* Release memory */
|
||||
pfree(values);
|
||||
pfree(nulls);
|
||||
@ -657,6 +660,8 @@ AlterObjectNamespace_internal(Relation rel, Oid objid, Oid nspOid)
|
||||
changeDependencyFor(classId, objid,
|
||||
NamespaceRelationId, oldNspOid, nspOid);
|
||||
|
||||
InvokeObjectPostAlterHook(classId, objid, 0);
|
||||
|
||||
return oldNspOid;
|
||||
}
|
||||
|
||||
@ -934,4 +939,6 @@ AlterObjectOwner_internal(Relation rel, Oid objectId, Oid new_ownerId)
|
||||
pfree(nulls);
|
||||
pfree(replaces);
|
||||
}
|
||||
|
||||
InvokeObjectPostAlterHook(classId, objectId, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user