Skip to content

Role Operations

Operation: createRole

pgm.createRole( role_name, role_options )

IMPORTANT

Create a new role - postgres docs

Arguments

NameTypeDescription
role_nameNamename of the new role
role_optionsobjectCheck below for available options

role_options

OptionTypeDescription
superuserbooleandefault false
createdbbooleandefault false
createrolebooleandefault false
inheritbooleandefault true
loginbooleandefault false
replicationbooleandefault false
bypassrlsboolean
limitnumber
passwordstring
encryptedbooleandefault true
validstringtimestamp
inRolestring or array[string]role or array of roles
rolestring or array[string]role or array of roles
adminstring or array[string]role or array of roles

Reverse Operation: dropRole

pgm.dropRole( role_name )

IMPORTANT

Drop a role - postgres docs

Arguments

NameTypeDescription
role_nameNamename of the role to drop

Operation: alterRole

pgm.alterRole( role_name, role_options )

IMPORTANT

Alter a role - postgres docs

Arguments

NameTypeDescription
role_nameNamename of the role
role_optionsobjectsee

Operation: renameRole

pgm.renameRole( old_role_name, new_role_name )

IMPORTANT

Rename a role - postgres docs

Arguments

NameTypeDescription
old_role_nameNameold name of the role
new_role_nameNamenew name of the role