The list of all the queries

Unused schemas

Query goal: Do not keep in your database elements that are not needed by anybody. These should be put in use or dropped, otherwise these are dead code.
Notes about the query: The query finds all the non-system schemas that do not contain any schema object.
Query type: Problem detection (Each row in the result could represent a flaw in the design)
Query reliability: High (Few or no false-positive results)
Query license: MIT License
Fixing suggestion: Drop the schema or start to use it.
Data source: system catalog only
SQL query: Click on query to copy it

SELECT nspname AS schema_name
FROM pg_namespace AS n INNER JOIN pg_authid AS a ON n.nspowner=a.oid
WHERE (nspname='public' OR rolname<>'postgres')
AND NOT EXISTS (SELECT 1
FROM pg_class AS c
WHERE n.oid=c.relnamespace)
AND NOT EXISTS (SELECT 1
FROM pg_type AS pt
WHERE n.oid=pt.typnamespace)
AND NOT EXISTS (SELECT 1
FROM pg_proc AS pc
WHERE n.oid=pc.pronamespace)
ORDER BY nspname;

SQL statements for generating SQL statements that help us to fix the problem

SQL queryDescription
SELECT format('DROP SCHEMA %1$I;', nspname) AS statements
FROM pg_namespace AS n INNER JOIN pg_authid AS a ON n.nspowner=a.oid
WHERE (nspname='public' OR rolname<>'postgres')
AND NOT EXISTS (SELECT 1
FROM pg_class AS c
WHERE n.oid=c.relnamespace)
AND NOT EXISTS (SELECT 1
FROM pg_type AS pt
WHERE n.oid=pt.typnamespace)
AND NOT EXISTS (SELECT 1
FROM pg_proc AS pc
WHERE n.oid=pc.pronamespace)
ORDER BY nspname;
Drop the schema.

Collections where the query belongs to

Collection nameCollection description
Find problems automaticallyQueries, that results point to problems in the database. Each query in the collection produces an initial assessment. However, a human reviewer has the final say as to whether there is a problem or not .

Categories where the query belongs to

Category nameCategory description
Comfortability of database evolutionQueries of this category provide information about the means that influence database evolution.
Unused implementation elementsQueries of this catergory provide information about the database objects that are not used.

Reference materials for further reading

Reference
https://en.wikipedia.org/wiki/Dead_code
The corresponding code smells in case of cleaning code are "F4: Dead Function" and "G9: Dead Code". (Robert C. Martin, Clean Code)

The list of all the queries