Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d5c0495

Browse files
committed
Fix event trigger support for the new ALTER OPERATOR command.
Also, the lock on pg_operator should not be released until end of transaction.
1 parent 321eed5 commit d5c0495

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/backend/commands/operatorcmds.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "access/htup_details.h"
3939
#include "catalog/dependency.h"
4040
#include "catalog/indexing.h"
41+
#include "catalog/objectaccess.h"
4142
#include "catalog/pg_operator.h"
4243
#include "catalog/pg_type.h"
4344
#include "commands/alter.h"
@@ -499,7 +500,11 @@ AlterOperator(AlterOperatorStmt *stmt)
499500
simple_heap_update(catalog, &tup->t_self, tup);
500501
CatalogUpdateIndexes(catalog, tup);
501502

502-
heap_close(catalog, RowExclusiveLock);
503+
InvokeObjectPostAlterHook(OperatorRelationId, oprId, 0);
504+
505+
ObjectAddressSet(address, OperatorRelationId, oprId);
506+
507+
heap_close(catalog, NoLock);
503508

504509
return address;
505510
}

0 commit comments

Comments
 (0)