@@ -76,7 +76,7 @@ static ObjectAddress create_table_using_stmt(CreateStmt *create_stmt,
7676Oid relowner );
7777
7878static void copy_foreign_keys (Oid parent_relid ,Oid partition_oid );
79- static void copy_acl_privileges (Oid parent_relid ,Oid partition_relid );
79+ static void postprocess_child_table_and_atts (Oid parent_relid ,Oid partition_relid );
8080
8181static Constraint * make_constraint_common (char * name ,Node * raw_expr );
8282
@@ -799,8 +799,8 @@ create_single_partition_internal(Oid parent_relid,
799799/* Make changes visible */
800800CommandCounterIncrement ();
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}
805805else if (IsA (cur_stmt ,CreateForeignTableStmt ))
806806{
@@ -880,9 +880,9 @@ create_table_using_stmt(CreateStmt *create_stmt, Oid relowner)
880880return table_addr ;
881881}
882882
883- /* Copy ACL privileges of parent table */
883+ /* Copy ACL privileges of parent tableand set "attislocal" = true */
884884static void
885- copy_acl_privileges (Oid parent_relid ,Oid partition_relid )
885+ postprocess_child_table_and_atts (Oid parent_relid ,Oid partition_relid )
886886{
887887Relation pg_class_rel ,
888888pg_attribute_rel ;
@@ -1039,10 +1039,16 @@ copy_acl_privileges(Oid parent_relid, Oid partition_relid)
10391039/* Copy ItemPointer of this tuple */
10401040iptr = subhtup -> t_self ;
10411041
1042+ /* Change ACL of this column */
10421043values [Anum_pg_attribute_attacl - 1 ]= acl_datum ;/* ACL array */
10431044nulls [Anum_pg_attribute_attacl - 1 ]= acl_null ;/* do we have ACL? */
10441045replaces [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 */
10471053subhtup = heap_modify_tuple (subhtup ,pg_attribute_desc ,
10481054values ,nulls ,replaces );