{"Entry":{"collection":"relopts","key":"view-security-barrier","name":"security_barrier","aliases":["view.security_barrier"],"metadata":{"aliases":["view.security_barrier"],"category":"View options","content_hash":"7f38efe384e77012fb031f5b4c68291bb4d338b305bd2dea28797bcefa61df93","imported_at":"2026-09-30T17:44:22.412363+08:00","name":"security_barrier","name_zh":"security_barrier","slug":"view-security-barrier","summary":"This should be used if the view is intended to provide row-level security. See Section 39.5 for full details."}},"Definition":{"Collection":"relopts","Key":"view-security-barrier","SourceDatabase":"center","Version":"18","SourceTable":"relopt","SourceKey":"view-security-barrier","SourceRevision":"eb6c2292fdf28e1b4635ab478eec3919411cdf4a6c07553387870e26201f3744","Facts":{"description":["This should be used if the view is intended to provide row-level security. See Section 39.5 for full details."],"facts":[{"label":"Applies to","value":"View options"},{"label":"Value type","value":"boolean"}],"related":[{"label":"CREATE VIEW","url":"/wiki/sql/create-view/?v=18"}],"release":{"channel":"stable","label":"18.6","major":"18","ref":"Local English manual 18.6","revision":"eb6c2292fdf28e1b4635ab478eec3919411cdf4a6c07553387870e26201f3744"},"sections":[{"paragraphs":["Views do not store query results. Set these security or update semantics with CREATE VIEW WITH or ALTER VIEW."],"title":"View options"},{"paragraphs":["If an automatically updatable view is marked with the security_barrier property then all the view's WHERE conditions (and any conditions using operators which are marked as LEAKPROOF ) will always be evaluated before any conditions that a user of the view has added. See Section 39.5 for full details. Note that, due to this, rows which are not ultimately returned (because they do not pass the user's WHERE conditions) may still end up being locked. EXPLAIN can be used to see which conditions are applied at the relation level (and therefore do not lock rows) and which are not."],"title":"Security semantics"}],"signature":"WITH (security_barrier = value)","sources":[{"label":"PostgreSQL 18 English manual","path":"sql-createview.html","sha256":"0c11551250a39c2136437e8cded6bcb5bb8d324fa60b9b2e86b2276ad60ee599","url":"/docs/18/sql-createview.html"}]},"ManualEvidence":{"release":{"channel":"stable","label":"18.6","major":"18","ref":"Local English manual 18.6","revision":"eb6c2292fdf28e1b4635ab478eec3919411cdf4a6c07553387870e26201f3744"},"sources":[{"label":"PostgreSQL 18 English manual","path":"sql-createview.html","sha256":"0c11551250a39c2136437e8cded6bcb5bb8d324fa60b9b2e86b2276ad60ee599","url":"/docs/18/sql-createview.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"relopts","Key":"view-security-barrier","SourceDatabase":"center","Version":"18","Locale":"en","Title":"security_barrier","Summary":"This should be used if the view is intended to provide row-level security. See Section 39.5 for full details.","BodyHTML":"\u003cp\u003eThis should be used if the view is intended to provide row-level security. See Section 39.5 for full details.\u003c/p\u003e","SourceRevision":"eb6c2292fdf28e1b4635ab478eec3919411cdf4a6c07553387870e26201f3744","ContentHash":"b271e4bfddd57930fd334762c6b011687a2f8b81707f599588e9e8e2d4e2ea59","Payload":{"description":["This should be used if the view is intended to provide row-level security. See Section 39.5 for full details."],"related":[{"label":"CREATE VIEW","url":"/wiki/sql/create-view/?v=18"}],"sections":[{"paragraphs":["Views do not store query results. Set these security or update semantics with CREATE VIEW WITH or ALTER VIEW."],"title":"View options"},{"paragraphs":["If an automatically updatable view is marked with the security_barrier property then all the view's WHERE conditions (and any conditions using operators which are marked as LEAKPROOF ) will always be evaluated before any conditions that a user of the view has added. See Section 39.5 for full details. Note that, due to this, rows which are not ultimately returned (because they do not pass the user's WHERE conditions) may still end up being locked. EXPLAIN can be used to see which conditions are applied at the relation level (and therefore do not lock rows) and which are not."],"title":"Security semantics"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
