PostgreSQL Database 'Information' Script - is there one out there?

From: Edwin UY <edwin(dot)uy(at)gmail(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: PostgreSQL Database 'Information' Script - is there one out there?
Date: 2025-01-30 12:13:56
Message-ID: CA+wokJ-C+M8Kw8JrdoH5qn25B2fz0beyLOxVSMTN5g6_NUqDAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

Does anyone know of any existing script/s out there somewhere that
generates some kind of database/instance inventory, like listing of what
databases exist (\l), schema (\dn) in each databases, extensions (\dx),
user lists (\du), replication slots, tables, views, parameter
default/non-default settings etc?
Maybe there is already one out there, either a shell script or a SQL script
that I can just run from psql and save the output to file.
At the moment, running manually via psql running \l, running \c to each DB
and running \dn, didn't realize I have to run \dn on each database :(, and
running select statements from pg_tables and so on.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Laurenz Albe 2025-01-30 14:01:53 Re: Partition management - best practices and avoid long access exclusive lock during partition creation
Previous Message Samuel VISCAPI 2025-01-30 09:54:26 RE: 2nd PostgreSQL server in WAL shipping cluster fails to start