3

I have a Postgres 9.5 server with 30 databases.

I would like to find out which database uses which extension(s) in one go, preferably in a query that is usable in pgAdmin.

I know that SELECT * FROM pg_extension gives me the extensions for the database I am connected to.

I also know that SELECT * FROM pg_available_extensions lists, well, all available extensions.

I also know that SELECT * FROM pg_database lists all existing databases.

Question

How can I create a list that includes the database name and the extensions used in each database?

1

1 Answer 1

0

You connect to each database in turn and query pg_extension.

1
  • Is there away to do this in an automated way? like a script to give to psql or something
    – pablete
    Jun 5, 2023 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.