Skip to main content
Version: 7.2

PolicyDef <T>

Definition of a PostgreSQL row level security policy on a table.

Index

Properties

optionalcheck

check?: string | RawQueryFragment<string> | PolicyCallback<T>

WITH CHECK expression validating written rows. Can be a string, Raw query, or callback receiving column name mappings.

optionalcommand

command?: insert | update | delete | select | all

DML command the policy applies to. Defaults to 'all'.

optionalname

name?: string

Policy name. Auto-generated if omitted.

optionalroles

roles?: string[]

Database roles the policy applies to. Defaults to PUBLIC.

optionaltype

type?: permissive | restrictive

Whether the policy is permissive (OR-combined) or restrictive (AND-combined). Defaults to 'permissive'.

optionalusing

using?: string | RawQueryFragment<string> | PolicyCallback<T>

USING expression filtering visible rows. Can be a string, Raw query, or callback receiving column name mappings.

Page Options