You should probably look at check_postgres and check_pgactivity. Their source code contain numerous SQL queries, that could help you write your own.
Regards.
Thank you very much. I am a bit new to postgres here. Can you please guide me , where exactly I can get the source code for check_postgres and check_pgactivity?
From:
Adrian Klaver Date: Subject:
Re: Help in vetting outcome of "vacuumdb --analyze-in-stages" - during DB Upgrade from EC2- PGS - Community Edn ver 13.X to 14.X