{"Entry":{"collection":"hook","key":"row_security_policy_hook_permissive","name":"row_security_policy_hook_permissive","aliases":[],"metadata":{"aliases":[],"category":"Permissions and object access","content_hash":"ef26807d10f253e7fc7572a7ab90ae1298136995c999cb90c00169759f9ecb55","derived_content_hash":"75e38a73b78c6bfaa5303769232fc9bcf5561f154b02cde9cc940d6d41826943","imported_at":"2026-09-27T17:57:58.857424+08:00","name":"row_security_policy_hook_permissive","name_zh":"row_security_policy_hook_permissive","repair_provenance":{"original_source_revision":"","receipt_sha256":"0d1f43ec114f4fc784666510a1fbeba3b5ccf1e70ff6e41a2845daab997d4fa8","repair":"wiki-repair-20261023"},"slug":"row_security_policy_hook_permissive","source_rev":"wiki-repair-20261023:15ab79041643c9ab17f425d9b328553a54981adfbd3928382aef4a7f441bb3a6","summary":"hooks to allow extensions to add their own security policies row_security_policy_hook_permissive can be used to add policies which are combined with the other permissive policies, using OR. row_security_policy_hook_restrictive can be used to add policies which are enforced, regardless of other policies (they are combined using AND)."}},"Definition":{"Collection":"hook","Key":"row_security_policy_hook_permissive","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"row_security_policy_hook_permissive","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["hooks to allow extensions to add their own security policies row_security_policy_hook_permissive can be used to add policies which are combined with the other permissive policies, using OR. row_security_policy_hook_restrictive can be used to add policies which are enforced, regardless of other policies (they are combined using AND)."],"description_zh":"这些钩子允许扩展添加自己的安全策略。row_security_policy_hook_permissive 添加的策略通过 OR 与其他宽松策略组合；row_security_policy_hook_restrictive 添加的策略始终必须满足，通过 AND 与其他策略组合。","description_zh_html":"\u003cp\u003e这些钩子允许扩展添加自己的安全策略。row_security_policy_hook_permissive 添加的策略通过 OR 与其他宽松策略组合；row_security_policy_hook_restrictive 添加的策略始终必须满足，通过 AND 与其他策略组合。\u003c/p\u003e\u003cp\u003e以下中文为本站依据所列 PostgreSQL 源码注释编译的说明。\u003c/p\u003e\u003ch3\u003e接口声明\u003c/h3\u003e\u003cpre\u003etypedef List *(*row_security_policy_hook_type) (CmdType cmdtype, Relation relation);\nextern PGDLLIMPORT row_security_policy_hook_type row_security_policy_hook_permissive;\u003c/pre\u003e\u003ch3\u003e调用位置\u003c/h3\u003e\u003cul\u003e\u003cli\u003e\u003ccode\u003esrc/backend/rewrite/rowsecurity.c:644\u003c/code\u003e\u003c/li\u003e\u003c/ul\u003e\u003ch3\u003e核心调用上下文：src/backend/rewrite/rowsecurity.c:638–652\u003c/h3\u003e\u003cpre\u003e\t\t}\n\t}\n\n\tif (row_security_policy_hook_permissive)\n\t{\n\t\tList\t   *hook_policies =\n\t\t\t(*row_security_policy_hook_permissive) (cmd, relation);\n\n\t\tforeach(item, hook_policies)\n\t\t{\n\t\t\tRowSecurityPolicy *policy = (RowSecurityPolicy *) lfirst(item);\n\n\t\t\tif (check_role_for_policy(policy-\u0026gt;roles, user_id))\n\t\t\t\t*permissive_policies = lappend(*permissive_policies, policy);\n\t\t}\u003c/pre\u003e","facts":[{"label":"Interface type","value":"row_security_policy_hook_type"},{"label":"Header","value":"src/include/rewrite/rowsecurity.h"},{"label":"Subsystem","value":"Permissions and object access"},{"label":"Initial value","value":"NULL (no hook installed)"}],"related":[{"label":"Row Security Policies","url":"/docs/18/ddl-rowsecurity.html"}],"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sections":[{"paragraphs":["src/backend/rewrite/rowsecurity.c:644"],"title":"Call sites"},{"code":"\t\t}\n\t}\n\n\tif (row_security_policy_hook_permissive)\n\t{\n\t\tList\t   *hook_policies =\n\t\t\t(*row_security_policy_hook_permissive) (cmd, relation);\n\n\t\tforeach(item, hook_policies)\n\t\t{\n\t\t\tRowSecurityPolicy *policy = (RowSecurityPolicy *) lfirst(item);\n\n\t\t\tif (check_role_for_policy(policy-\u003eroles, user_id))\n\t\t\t\t*permissive_policies = lappend(*permissive_policies, policy);\n\t\t}","paragraphs":[],"title":"Core call context: src/backend/rewrite/rowsecurity.c:638–652"}],"signature":"typedef List *(*row_security_policy_hook_type) (CmdType cmdtype, Relation relation);\nextern PGDLLIMPORT row_security_policy_hook_type row_security_policy_hook_permissive;","sources":[{"label":"Interface declaration","path":"src/include/rewrite/rowsecurity.h","sha256":"3b195aed12c4378146a3e74d7873676f6e7e80f18f4fe9ef6bc125ef2f9cea24","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/rewrite/rowsecurity.h#L37"},{"label":"Core definition","path":"src/backend/rewrite/rowsecurity.c","sha256":"dca1d39120cb8f5cca60caf1264de7c3b5ce6f30c1a17ce1d5a42da0be6cf75c","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/rewrite/rowsecurity.c#L86"},{"label":"Call sites","path":"src/backend/rewrite/rowsecurity.c","sha256":"dca1d39120cb8f5cca60caf1264de7c3b5ce6f30c1a17ce1d5a42da0be6cf75c","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/rewrite/rowsecurity.c#L644"}],"translation_provenance":{"inputs":[{"label":"Interface declaration","path":"src/include/rewrite/rowsecurity.h","sha256":"3b195aed12c4378146a3e74d7873676f6e7e80f18f4fe9ef6bc125ef2f9cea24","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/rewrite/rowsecurity.h#L37"},{"label":"Core definition","path":"src/backend/rewrite/rowsecurity.c","sha256":"dca1d39120cb8f5cca60caf1264de7c3b5ce6f30c1a17ce1d5a42da0be6cf75c","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/rewrite/rowsecurity.c#L86"},{"label":"Call sites","path":"src/backend/rewrite/rowsecurity.c","sha256":"dca1d39120cb8f5cca60caf1264de7c3b5ce6f30c1a17ce1d5a42da0be6cf75c","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/rewrite/rowsecurity.c#L644"}],"kind":"authored-source-translation","locale":"zh-Hans","source_revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","translated_source_sha256":"9a48c4c5f12d241411c9af8d4f6f3f53ae84cfdf2c04dc3427d036f5d314179d","version":"18"},"zh_from":"authored-source-translation"},"ManualEvidence":{"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sources":[{"label":"Interface declaration","path":"src/include/rewrite/rowsecurity.h","sha256":"3b195aed12c4378146a3e74d7873676f6e7e80f18f4fe9ef6bc125ef2f9cea24","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/rewrite/rowsecurity.h#L37"},{"label":"Core definition","path":"src/backend/rewrite/rowsecurity.c","sha256":"dca1d39120cb8f5cca60caf1264de7c3b5ce6f30c1a17ce1d5a42da0be6cf75c","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/rewrite/rowsecurity.c#L86"},{"label":"Call sites","path":"src/backend/rewrite/rowsecurity.c","sha256":"dca1d39120cb8f5cca60caf1264de7c3b5ce6f30c1a17ce1d5a42da0be6cf75c","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/rewrite/rowsecurity.c#L644"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"row_security_policy_hook_permissive","SourceDatabase":"center","Version":"18","Locale":"en","Title":"row_security_policy_hook_permissive","Summary":"hooks to allow extensions to add their own security policies row_security_policy_hook_permissive can be used to add policies which are combined with the other permissive policies, using OR. row_security_policy_hook_restrictive can be used to add policies which are enforced, regardless of other policies (they are combined using AND).","BodyHTML":"\u003cp\u003ehooks to allow extensions to add their own security policies row_security_policy_hook_permissive can be used to add policies which are combined with the other permissive policies, using OR. row_security_policy_hook_restrictive can be used to add policies which are enforced, regardless of other policies (they are combined using AND).\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"7d594276c434a8e278ee54f60c9494a1fe38d8ef90d8c7b7bbe82f6aaddcda51","Payload":{"description":["hooks to allow extensions to add their own security policies row_security_policy_hook_permissive can be used to add policies which are combined with the other permissive policies, using OR. row_security_policy_hook_restrictive can be used to add policies which are enforced, regardless of other policies (they are combined using AND)."],"related":[{"label":"Row Security Policies","url":"/docs/18/ddl-rowsecurity.html"}],"sections":[{"paragraphs":["src/backend/rewrite/rowsecurity.c:644"],"title":"Call sites"},{"code":"\t\t}\n\t}\n\n\tif (row_security_policy_hook_permissive)\n\t{\n\t\tList\t   *hook_policies =\n\t\t\t(*row_security_policy_hook_permissive) (cmd, relation);\n\n\t\tforeach(item, hook_policies)\n\t\t{\n\t\t\tRowSecurityPolicy *policy = (RowSecurityPolicy *) lfirst(item);\n\n\t\t\tif (check_role_for_policy(policy-\u003eroles, user_id))\n\t\t\t\t*permissive_policies = lappend(*permissive_policies, policy);\n\t\t}","paragraphs":[],"title":"Core call context: src/backend/rewrite/rowsecurity.c:638–652"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
