skip to Main Content

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

How to recreate the said schema?

2

Answers


  1. Chosen as BEST ANSWER

    Ran the script from https://github.com/postgres/postgres/blob/REL_15_4/src/backend/catalog/information_schema.sql

    Matched the to my postgres version though this file hasn't changed much.

    Seems to be going good so far fingers crossed.


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search