Create a new policy - postgres docs
Arguments:
tableName
[Name] - name of the table to alterpolicyName
[string] - name of the new policyoptions
[object] - options:command
[string] -ALL
,SELECT
,INSERT
,UPDATE
, orDELETE
role
[string or array] - the role(s) to which the policy is to be appliedusing
[string] - SQL conditional expression for visibility checkcheck
[string] - SQL conditional expression for insert/update check
Reverse Operation: dropPolicy
Drop a policy - postgres docs
Arguments:
tableName
[Name] - name of the table where the policy ispolicyName
[string] - name of the policy to deleteoptions
[object] - options:ifExists
[boolean] - drops policy only if it exists
Alter a policy - postgres docs
Arguments:
tableName
[Name] - name of the table where the policy ispolicyName
[string] - name of the policy to alteroptions
[object] - options:role
[string or array] - the role(s) to which the policy is to be appliedusing
[string] - SQL conditional expression for visibility checkcheck
[string] - SQL conditional expression for insert/update check
Rename a policy - postgres docs
Arguments:
tableName
[Name] - name of the table where the policy ispolicyName
[string] - old name of the policynewPolicyName
[string] - new name of the policy