Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7b56584

Browse files
committed
Add call to object access hook at the end of table rewrite in ALTER TABLE
ALTER TABLE .. SET {LOGGED,UNLOGGED,ACCESS METHOD} would never do atable-level object access hook, which was inconsistent with SETTABLESPACE. Note that contrary to SET TABLESPACE, the no-op case isleft off for those commands as this requires tracking if commands havebeen called, but they may not execute a physical rewrite. Another thingworth noting is that the physical file swap at the end of a rewritedoes a couple of access calls for internal objects created for the swapoperation (internal objects are for example skipped by the tests ofsepgsql), but this does not trigger the hook for the table on which theoperation is done.f41872d, that added support for SET LOGGED/UNLOGGED in ALTER TABLE,visibly forgot to consider that.Based on what I checked, two regression tests of sepgsql in ddl.sql aregoing to log more information with this test, something that buildfarmmember rhinoceros will tell soon enough. I am not completely sure oftheir format though, so these are not refreshed yet.This is arguably a bug, but no backpatch is done as this could cause abehavior change for anybody using object access hooks.Reported-by: Jeff DavisDiscussion:https://postgr.es/m/YQJKV29/1a60uG68@paquier.xyz
1 parent18bac60 commit7b56584

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5475,6 +5475,8 @@ ATRewriteTables(AlterTableStmt *parsetree, List **wqueue, LOCKMODE lockmode,
54755475
RecentXmin,
54765476
ReadNextMultiXactId(),
54775477
persistence);
5478+
5479+
InvokeObjectPostAlterHook(RelationRelationId, tab->relid, 0);
54785480
}
54795481
else
54805482
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp