I accidentally ran and committed drop schema information_schema cascade
on postgres 15.4 as a DBA.
How to recreate the said schema?
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
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.
Create a new database, take a
pg_dump
of the database where you droppedinformation_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.