PostgreSQL – Renaming a Schema

Below is the command to rename a schema in postgres database where ‘schemaname‘ is the current name of the schema and ‘newschemaname‘ is the new name.

ALTER SCHEMA schemaname RENAME to newschemaname;

See also  PostgreSQL - Get current database name