Hello!

Generally looks good to me, the tests work, the new feature seem to
work, I only noticed a few minor things.

parse_utilcmd.c:2204
+ ereport(ERROR,
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot convert whole-row table reference"),
+ errdetail("Security policy \"%s\" contains a whole-row reference to
table \"%s\".",
+   NameStr(policy_form->polname),
+   RelationGetRelationName(parent_rel)));

The outer parentheses are missing after "ERROR, "

Same issue at line 2232.

parse_utilcmd:1634
+ policy_form = (Form_pg_policy) GETSTRUCT(tuple);
+
+ polrels = PolicyGetRelations(policy_form->oid);

Shouldn't the function free polrels after the foreach below?

policy.c:1357
+
+ relation_close(depRel, AccessShareLock);
+

Shouldn't that be table_close?

create_table.sgml:760
+          All row-level security policies are copied to the new table.
+          Note that by default row-level security is not enabled to
the new table,
+          using <command>ALTER TABLE ... ENABLE ROW LEVEL SECURITY</command>
+          in order for created policies to be applied to the new table.

Maybe "use ALTER TABLE ... ENABLE ROW LEVEL SECURITY to copy existing
policies to the new table"?

I am also wondering if this shouldn't be at least an option for CREATE
TABLE AS. This seems like something that's very easy to overlook and
accidentally forget.


Reply via email to