1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +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:
Robert Haas
2013-03-17 22:55:14 -04:00
parent 6ac7facdd3
commit 05f3f9c7b2
31 changed files with 375 additions and 53 deletions

View File

@ -997,6 +997,8 @@ RenameDatabase(const char *oldname, const char *newname)
simple_heap_update(rel, &newtup->t_self, newtup);
CatalogUpdateIndexes(rel, newtup);
InvokeObjectPostAlterHook(DatabaseRelationId, db_id, 0);
/*
* Close pg_database, but keep lock till commit.
*/
@ -1234,6 +1236,9 @@ movedb(const char *dbname, const char *tblspcname)
/* Update indexes */
CatalogUpdateIndexes(pgdbrel, newtuple);
InvokeObjectPostAlterHook(DatabaseRelationId,
HeapTupleGetOid(newtuple), 0);
systable_endscan(sysscan);
/*
@ -1431,6 +1436,9 @@ AlterDatabase(AlterDatabaseStmt *stmt, bool isTopLevel)
/* Update indexes */
CatalogUpdateIndexes(rel, newtuple);
InvokeObjectPostAlterHook(DatabaseRelationId,
HeapTupleGetOid(newtuple), 0);
systable_endscan(scan);
/* Close pg_database, but keep lock till commit */
@ -1570,6 +1578,8 @@ AlterDatabaseOwner(const char *dbname, Oid newOwnerId)
newOwnerId);
}
InvokeObjectPostAlterHook(DatabaseRelationId, HeapTupleGetOid(tuple), 0);
systable_endscan(scan);
/* Close pg_database, but keep lock till commit */