Skip to content

Instantly share code, notes, and snippets.

@dungsaga
Last active February 18, 2022 08:19
Show Gist options
  • Save dungsaga/abe9b29017772d66c5dd3badabda4416 to your computer and use it in GitHub Desktop.
Save dungsaga/abe9b29017772d66c5dd3badabda4416 to your computer and use it in GitHub Desktop.
re-create schema information_schema of a PostgreSql database

reference: https://www.postgresql.org/message-id/[email protected]

Since the view definition is installed by initdb, merely upgrading will
not fix the problem. If you need to fix this in an existing installation,
you can (as a superuser) drop the information_schema schema then re-create
it by sourcing SHAREDIR/information_schema.sql. (Run pg_config --sharedir
if you're uncertain where SHAREDIR is.) This must be repeated in each
database to be fixed.
  • find SHAREDIR by running pg_config --sharedir
  • run script SHAREDIR/information_schema.sql to re-create schema information_schema
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment