The following commands have been missing calls to object access hooks
InvokeObjectPost{Create|Alter}Hook normally applied to all commands:
- ALTER RULE RENAME TO
- ALTER USER MAPPING
- CREATE ACCESS METHOD
- CREATE STATISTICS
Thanks also to Robert Haas for the discussion.
Author: Mark Dilger
Reviewed-by: Álvaro Herrera, Michael Paquier
Discussion: https://postgr.es/m/
435CD295-F409-44E0-91EC-
DF32C7AFCD76@enterprisedb.com
#include "catalog/catalog.h"
#include "catalog/dependency.h"
#include "catalog/indexing.h"
+#include "catalog/objectaccess.h"
#include "catalog/pg_am.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
recordDependencyOnCurrentExtension(&myself, false);
+ InvokeObjectPostCreateHook(AccessMethodRelationId, amoid, 0);
+
table_close(rel, RowExclusiveLock);
return myself;
CatalogTupleUpdate(rel, &tp->t_self, tp);
+ InvokeObjectPostAlterHook(UserMappingRelationId,
+ umId, 0);
+
ObjectAddressSet(address, UserMappingRelationId, umId);
heap_freetuple(tp);
relation_close(datarel, RowExclusiveLock);
+ InvokeObjectPostCreateHook(StatisticExtRelationId, statoid, 0);
+
/*
* Invalidate relcache so that others see the new statistics object.
*/
CatalogTupleUpdate(pg_rewrite_desc, &ruletup->t_self, ruletup);
+ InvokeObjectPostAlterHook(RewriteRelationId, ruleOid, 0);
+
heap_freetuple(ruletup);
table_close(pg_rewrite_desc, RowExclusiveLock);