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

Commit4323142

Browse files
committed
Feed ObjectAddress to event triggers for ALTER TABLE ATTACH/DETACH
These flavors of ALTER TABLE were already shaped to report theObjectAddress of the partition attached or detached, but this data wasnot added to what is collected for event triggers. The tests oftest_ddl_deparse are updated to show the modification in the datareported.Author: Hou ZhijieReviewed-by: Álvaro Herrera, Amit Kapila, Hayato Kuroda, Michael PaquierDiscussion:https://postgr.es/m/OS0PR01MB571626984BD099DADF53F38394899@OS0PR01MB5716.jpnprd01.prod.outlook.com
1 parent07ff701 commit4323142

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5202,24 +5202,24 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab,
52025202
cur_pass, context);
52035203
Assert(cmd != NULL);
52045204
if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
5205-
ATExecAttachPartition(wqueue, rel, (PartitionCmd *) cmd->def,
5206-
context);
5205+
address =ATExecAttachPartition(wqueue, rel, (PartitionCmd *) cmd->def,
5206+
context);
52075207
else
5208-
ATExecAttachPartitionIdx(wqueue, rel,
5209-
((PartitionCmd *) cmd->def)->name);
5208+
address =ATExecAttachPartitionIdx(wqueue, rel,
5209+
((PartitionCmd *) cmd->def)->name);
52105210
break;
52115211
case AT_DetachPartition:
52125212
cmd = ATParseTransformCmd(wqueue, tab, rel, cmd, false, lockmode,
52135213
cur_pass, context);
52145214
Assert(cmd != NULL);
52155215
/* ATPrepCmd ensures it must be a table */
52165216
Assert(rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE);
5217-
ATExecDetachPartition(wqueue, tab, rel,
5218-
((PartitionCmd *) cmd->def)->name,
5219-
((PartitionCmd *) cmd->def)->concurrent);
5217+
address =ATExecDetachPartition(wqueue, tab, rel,
5218+
((PartitionCmd *) cmd->def)->name,
5219+
((PartitionCmd *) cmd->def)->concurrent);
52205220
break;
52215221
case AT_DetachPartitionFinalize:
5222-
ATExecDetachPartitionFinalize(rel, ((PartitionCmd *) cmd->def)->name);
5222+
address =ATExecDetachPartitionFinalize(rel, ((PartitionCmd *) cmd->def)->name);
52235223
break;
52245224
default:/* oops */
52255225
elog(ERROR, "unrecognized alter table type: %d",

‎src/test/modules/test_ddl_deparse/expected/alter_table.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ CREATE TABLE part2 (a int);
5050
NOTICE: DDL test: type simple, tag CREATE TABLE
5151
ALTER TABLE part ATTACH PARTITION part2 FOR VALUES FROM (101) to (200);
5252
NOTICE: DDL test: type alter table, tag ALTER TABLE
53-
NOTICE: subcommand: type ATTACH PARTITION desc<NULL>
53+
NOTICE: subcommand: type ATTACH PARTITION desctable part2
5454
ALTER TABLE part DETACH PARTITION part2;
5555
NOTICE: DDL test: type alter table, tag ALTER TABLE
56-
NOTICE: subcommand: type DETACH PARTITION desc<NULL>
56+
NOTICE: subcommand: type DETACH PARTITION desctable part2
5757
DROP TABLE part2;
5858
ALTER TABLE part ADD PRIMARY KEY (a);
5959
NOTICE: DDL test: type alter table, tag ALTER TABLE

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp