{"Entry":{"collection":"catalog","key":"pg_policy","name":"pg_policy","aliases":[],"metadata":{"changed_in":["10","12"],"changes":[{"added":[],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.4","order":false,"removed":[],"status":"added","to":"9.5","types":[]},{"added":["polpermissive"],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.6","listing":[],"order":false,"removed":[],"status":"changed","to":"10","types":[],"unlisted":[]},{"added":[],"attributes":[{"attribute":"not_null","from":false,"name":"polroles","to":true},{"attribute":"hidden","from":true,"name":"oid","to":false}],"description_changed":false,"descriptions":[],"from":"11","listing":[],"order":false,"removed":[],"status":"changed","to":"12","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[],"from":"12","listing":["oid"],"order":false,"removed":[],"status":"reworded","to":"13","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[{"from":"The roles to which the policy is applied","name":"polroles","to":"The roles to which the policy is applied; zero means PUBLIC (and normally appears alone in the array)"}],"from":"13","listing":[],"order":false,"removed":[],"status":"reworded","to":"14","types":[],"unlisted":[]}],"column_count":8,"content_hash":"da03c1317fc44ff375eb7573b454a0865de59fed87a64302c4e9f061dc152fea","first_version":"9.5","imported_at":"2026-09-30T00:40:55.683696+08:00","kind":"catalog","last_version":"20","name":"pg_policy","position":54,"present_in":["9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"relation_oid":null,"relkind":"r","shared":false,"source_rev":"english-manuals:309d32f7e91f87650377ac3ce54260eccadfc4fbd36902d489d09206b4572738","summary":"The catalog pg_policy stores row-level security policies for tables.","summary_zh":""}},"Definition":{"Collection":"catalog","Key":"pg_policy","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_policy","SourceRevision":"english-manuals:309d32f7e91f87650377ac3ce54260eccadfc4fbd36902d489d09206b4572738","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"Row identifier","description_zh":"","documented":true,"documented_name":"oid","hidden":false,"name":"oid","not_null":true,"references":"","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":2,"description":"The name of the policy","description_zh":"","documented":true,"documented_name":"polname","hidden":false,"name":"polname","not_null":true,"references":"","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":3,"description":"The table to which the policy applies","description_zh":"","documented":true,"documented_name":"polrelid","hidden":false,"name":"polrelid","not_null":true,"references":"pg_class.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":4,"description":"The command type to which the policy is applied: r for SELECT, a for INSERT, w for UPDATE, d for DELETE, or * for all","description_zh":"","documented":true,"documented_name":"polcmd","hidden":false,"name":"polcmd","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":5,"description":"Is the policy permissive or restrictive?","description_zh":"","documented":true,"documented_name":"polpermissive","hidden":false,"name":"polpermissive","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":1,"attnum":6,"description":"The roles to which the policy is applied; zero means PUBLIC (and normally appears alone in the array)","description_zh":"","documented":true,"documented_name":"polroles","hidden":false,"name":"polroles","not_null":true,"references":"pg_authid.oid","type":"oid[]","type_modifier":-1,"type_oid":1028},{"array_dimensions":0,"attnum":7,"description":"The expression tree to be added to the security barrier qualifications for queries that use the table","description_zh":"","documented":true,"documented_name":"polqual","hidden":false,"name":"polqual","not_null":false,"references":"","type":"pg_node_tree","type_modifier":-1,"type_oid":194},{"array_dimensions":0,"attnum":8,"description":"The expression tree to be added to the WITH CHECK qualifications for queries that attempt to add rows to the table","description_zh":"","documented":true,"documented_name":"polwithcheck","hidden":false,"name":"polwithcheck","not_null":false,"references":"","type":"pg_node_tree","type_modifier":-1,"type_oid":194}],"description":"The catalog pg_policy stores row-level security policies for tables. A policy includes the kind of command that it applies to (possibly all commands), the roles that it applies to, the expression to be added as a security-barrier qualification to queries that include the table, and the expression to be added as a WITH CHECK option for queries that attempt to add new records to the table.","description_zh":"","doc":{"anchor":"id-1.10.4.40.4","file":"catalog-pg-policy.html","lang":"en","sha256":"a0d76880f7c4f3b5b8ed163063c16811a1f79246bf8d8d05afb4ff1f8c92dd5c","slug":"18"},"kind":"catalog","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["oid","polname","polrelid","polcmd","polpermissive","polroles","polqual","polwithcheck"],"runtime_verified":false,"source":"english-manual"},"ManualEvidence":{"doc":{"anchor":"id-1.10.4.40.4","file":"catalog-pg-policy.html","lang":"en","sha256":"a0d76880f7c4f3b5b8ed163063c16811a1f79246bf8d8d05afb4ff1f8c92dd5c","slug":"18"}},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["oid","polname","polrelid","polcmd","polpermissive","polroles","polqual","polwithcheck"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_policy","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_policy","Summary":"目录pg_policy存储着表的行级安全策略。一个策略包括它适用的命令种类（可能适用于所有命令）、它适用的角色、被作为安全屏障条件增加到包括该表的查询的表达式以及被作为 WITH CHECK选项增加到尝试向表增加新记录的查询的表达式。","BodyHTML":"\u003cp\u003e目录pg_policy存储着表的行级安全策略。一个策略包括它适用的命令种类（可能适用于所有命令）、它适用的角色、被作为安全屏障条件增加到包括该表的查询的表达式以及被作为 WITH CHECK选项增加到尝试向表增加新记录的查询的表达式。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"ca148e7b3100b854ccde4d9d2efba6eea679fe6271bb874871b306a209e0bb83","Payload":{"columns":[{"description_zh":"行标识符","name":"oid","type":"oid","zh_from":"doc"},{"description_zh":"策略的名称","name":"polname","type":"name","zh_from":"doc"},{"description_zh":"策略适用的表","name":"polrelid","type":"oid","zh_from":"doc"},{"description_zh":"策略适用的命令类型：r 表示SELECT，a 表示INSERT，w 表示UPDATE，d 表示DELETE，*表示所有命令类型","name":"polcmd","type":"\"char\"","zh_from":"doc"},{"description_zh":"策略是宽松的还是限制性的？","name":"polpermissive","type":"boolean","zh_from":"doc"},{"description_zh":"策略适用的角色；零意味着PUBLIC（通常在数组中单独出现）","name":"polroles","type":"oid[]","zh_from":"doc"},{"description_zh":"被作为安全屏障条件增加到使用该表的查询的表达式树","name":"polqual","type":"pg_node_tree","zh_from":"doc"},{"description_zh":"被作为 WITH CHECK 条件增加到尝试向表增加行的查询的表达式树","name":"polwithcheck","type":"pg_node_tree","zh_from":"doc"}],"description_zh":"目录pg_policy存储着表的行级安全策略。一个策略包括它适用的命令种类（可能适用于所有命令）、它适用的角色、被作为安全屏障条件增加到包括该表的查询的表达式以及被作为 WITH CHECK选项增加到尝试向表增加新记录的查询的表达式。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
