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

Commit92251fb

Browse files
committed
rename copy_acl_privileges() -> postprocess_child_table_and_atts(), set 'attislocal' = true for child attributes
1 parentdd4b33b commit92251fb

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

‎src/partition_creation.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static ObjectAddress create_table_using_stmt(CreateStmt *create_stmt,
7676
Oidrelowner);
7777

7878
staticvoidcopy_foreign_keys(Oidparent_relid,Oidpartition_oid);
79-
staticvoidcopy_acl_privileges(Oidparent_relid,Oidpartition_relid);
79+
staticvoidpostprocess_child_table_and_atts(Oidparent_relid,Oidpartition_relid);
8080

8181
staticConstraint*make_constraint_common(char*name,Node*raw_expr);
8282

@@ -799,8 +799,8 @@ create_single_partition_internal(Oid parent_relid,
799799
/* Make changes visible */
800800
CommandCounterIncrement();
801801

802-
/* Copy ACL privileges of the parent table */
803-
copy_acl_privileges(parent_relid,partition_relid);
802+
/* Copy ACL privileges of the parent tableand set "attislocal"*/
803+
postprocess_child_table_and_atts(parent_relid,partition_relid);
804804
}
805805
elseif (IsA(cur_stmt,CreateForeignTableStmt))
806806
{
@@ -880,9 +880,9 @@ create_table_using_stmt(CreateStmt *create_stmt, Oid relowner)
880880
returntable_addr;
881881
}
882882

883-
/* Copy ACL privileges of parent table */
883+
/* Copy ACL privileges of parent tableand set "attislocal" = true*/
884884
staticvoid
885-
copy_acl_privileges(Oidparent_relid,Oidpartition_relid)
885+
postprocess_child_table_and_atts(Oidparent_relid,Oidpartition_relid)
886886
{
887887
Relationpg_class_rel,
888888
pg_attribute_rel;
@@ -1039,10 +1039,16 @@ copy_acl_privileges(Oid parent_relid, Oid partition_relid)
10391039
/* Copy ItemPointer of this tuple */
10401040
iptr=subhtup->t_self;
10411041

1042+
/* Change ACL of this column */
10421043
values[Anum_pg_attribute_attacl-1]=acl_datum;/* ACL array */
10431044
nulls[Anum_pg_attribute_attacl-1]=acl_null;/* do we have ACL? */
10441045
replaces[Anum_pg_attribute_attacl-1]= true;
10451046

1047+
/* Change 'attislocal' for DROP COLUMN */
1048+
values[Anum_pg_attribute_attislocal-1]= false;/* should not be local */
1049+
nulls[Anum_pg_attribute_attislocal-1]= false;/* NOT NULL */
1050+
replaces[Anum_pg_attribute_attislocal-1]= true;
1051+
10461052
/* Build new tuple with parent's ACL */
10471053
subhtup=heap_modify_tuple(subhtup,pg_attribute_desc,
10481054
values,nulls,replaces);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp