Create a new policy - postgres docs
Arguments:
tableName[Name] - name of the table to alterpolicyName[string] - name of the new policyoptions[object] - options:restrictive[boolean] -RESTRICTIVEinstead ofPERMISSIVEcommand[string] -ALL,SELECT,INSERT,UPDATE, orDELETErole[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 checkcomment[string or null] - comment on the policy
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 checkcomment[string or null] - comment on the policy
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