PostgreSQL – Move table from one schema to another

Below command can be used to move table from one schema to another in Postgres database.

ALTER TABLE table_name SET SCHEMA schema_name;

Above command moves the dependent constraints, indexes and sequences also to the new schema along with the table.

See also  PostgreSQL - Get current database name