Skip to content

Schema Operations ​

Operation: createSchema ​

pgm.createSchema( schema_name, schema_options ) ​

IMPORTANT

Create a new schema - postgres docs

Arguments ​

NameTypeDescription
schema_namestringname of the new schema
schema_optionsobjectCheck below for available options

schema_options ​

OptionTypeDescription
ifNotExistsbooleanadds IF NOT EXISTS clause
authorizationstringalternative user to own new schema

Reverse Operation: dropSchema ​

pgm.dropSchema( schema_name, drop_options ) ​

IMPORTANT

Drop a schema - postgres docs

Arguments ​

NameTypeDescription
schema_namestringname of the schema to drop
drop_optionsobjectCheck below for available options

drop_options ​

OptionTypeDescription
ifExistsbooleandrops schema only if it exists
cascadebooleandrops also dependent objects

Operation: alterSchema ​

pgm.renameSchema( old_schema_name, new_schema_name ) ​

IMPORTANT

Rename a schema - postgres docs

Arguments ​

NameTypeDescription
old_schema_namestringold name of the schema
new_schema_namestringnew name of the schema