../../Desktop/pg_src/src1/postgres/src/backend/utils/adt/ruleutils.c: In function ‘get_formatted_string’: ../../Desktop/pg_src/src1/postgres/src/backend/utils/adt/ruleutils.c:13770:9: error: function ‘get_formatted_string’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] 13770 | appendStringInfoVA(buf, fmt, args); | ^~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors
I’m relatively new to PostgreSQL development. I’m working on setting up the CI pipeline and will try to fix all warnings.
row security policy qual and with_check_qual can contain sublink/subquery. but pg_get_expr can not cope with sublink/subquery.
see pg_get_expr comments below: * Currently, the expression can only refer to a single relation, namely * the one specified by the second parameter. This is sufficient for * partial indexes, column default expressions, etc. We also support * Var-free expressions, for which the OID can be InvalidOid.
I guess (because I can not compile, mentioned above): "ERROR: expression contains variables" can be triggered by the following setup:
create table t(a int); CREATE POLICY p1 ON t AS RESTRICTIVE FOR ALL USING (a IS NOT NULL AND (SELECT 1 = 1 FROM pg_rewrite WHERE pg_get_function_arg_default(ev_class, 1) !~~ pg_get_expr(ev_qual, 0, false))); SELECT pg_get_policy_ddl('t', 'p1', true);