Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a995b37

Browse files
committed
Add missing invocations to object access hooks
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
1 parent c99cec9 commit a995b37

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

src/backend/commands/amcmds.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "catalog/catalog.h"
1919
#include "catalog/dependency.h"
2020
#include "catalog/indexing.h"
21+
#include "catalog/objectaccess.h"
2122
#include "catalog/pg_am.h"
2223
#include "catalog/pg_proc.h"
2324
#include "catalog/pg_type.h"
@@ -107,6 +108,8 @@ CreateAccessMethod(CreateAmStmt *stmt)
107108

108109
recordDependencyOnCurrentExtension(&myself, false);
109110

111+
InvokeObjectPostCreateHook(AccessMethodRelationId, amoid, 0);
112+
110113
table_close(rel, RowExclusiveLock);
111114

112115
return myself;

src/backend/commands/foreigncmds.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,9 @@ AlterUserMapping(AlterUserMappingStmt *stmt)
13431343

13441344
CatalogTupleUpdate(rel, &tp->t_self, tp);
13451345

1346+
InvokeObjectPostAlterHook(UserMappingRelationId,
1347+
umId, 0);
1348+
13461349
ObjectAddressSet(address, UserMappingRelationId, umId);
13471350

13481351
heap_freetuple(tp);

src/backend/commands/statscmds.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ CreateStatistics(CreateStatsStmt *stmt)
374374

375375
relation_close(datarel, RowExclusiveLock);
376376

377+
InvokeObjectPostCreateHook(StatisticExtRelationId, statoid, 0);
378+
377379
/*
378380
* Invalidate relcache so that others see the new statistics object.
379381
*/

src/backend/rewrite/rewriteDefine.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,8 @@ RenameRewriteRule(RangeVar *relation, const char *oldName,
10031003

10041004
CatalogTupleUpdate(pg_rewrite_desc, &ruletup->t_self, ruletup);
10051005

1006+
InvokeObjectPostAlterHook(RewriteRelationId, ruleOid, 0);
1007+
10061008
heap_freetuple(ruletup);
10071009
table_close(pg_rewrite_desc, RowExclusiveLock);
10081010

0 commit comments

Comments
 (0)