Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 2.05 KB

policies.md

File metadata and controls

57 lines (37 loc) · 2.05 KB

Policies Operations

pgm.createPolicy( tableName, policyName, options )

Create a new policy - postgres docs

Arguments:

  • tableName [Name] - name of the table to alter
  • policyName [string] - name of the new policy
  • options [object] - options:
    • command [string] - ALL, SELECT, INSERT, UPDATE, or DELETE
    • role [string or array] - the role(s) to which the policy is to be applied
    • using [string] - SQL conditional expression for visibility check
    • check [string] - SQL conditional expression for insert/update check

Reverse Operation: dropPolicy


pgm.dropPolicy( tableName, policyName, options )

Drop a policy - postgres docs

Arguments:

  • tableName [Name] - name of the table where the policy is
  • policyName [string] - name of the policy to delete
  • options [object] - options:
    • ifExists [boolean] - drops policy only if it exists

pgm.alterPolicy( tableName, policyName, options )

Alter a policy - postgres docs

Arguments:

  • tableName [Name] - name of the table where the policy is
  • policyName [string] - name of the policy to alter
  • options [object] - options:
    • role [string or array] - the role(s) to which the policy is to be applied
    • using [string] - SQL conditional expression for visibility check
    • check [string] - SQL conditional expression for insert/update check

pgm.renamePolicy( tableName, policyName, newPolicyName )

Rename a policy - postgres docs

Arguments:

  • tableName [Name] - name of the table where the policy is
  • policyName [string] - old name of the policy
  • newPolicyName [string] - new name of the policy