postgresqldata-recoverypostgresql-15

Accidentally dropped information_schema postgres


I accidentally ran and committed drop schema information_schema cascade on postgres 15.4 as a DBA.

How to recreate the said schema?


Solution

  • Create a new database, take a pg_dump of the database where you dropped information_schema and restore it to the new database.

    Then you can drop the broken database and rename the new copy, and you have got the information_schema back.