Re: Toast table get list from instance - Mailing list pgsql-admin

From Kashif Zeeshan
Subject Re: Toast table get list from instance
Date
Msg-id CAAPsdhc7vusYTz_1y2n1M=P4gJ7D-6VwRMmebcnuXQHTaPKnpQ@mail.gmail.com
Whole thread Raw
In response to Toast table get list from instance  (Sathish Reddy <sathishreddy.postgresql@gmail.com>)
Responses Re: Toast table get list from instance
List pgsql-admin
You can use the following query to get the info from one database.

SELECT nspname AS schema_name, c.relname AS toast_table_name, c.oid AS toast_table_oid, r.relname AS main_table_name FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_class r ON r.reltoastrelid = c.oid WHERE c.relkind = 't';

But to get info from all the databases then you need to write a shell script which will first get all the databases and then run the above query on the all returned databases.

Regards
Kashif Zeeshan  

On Thu, Jul 4, 2024 at 2:52 PM Sathish Reddy <sathishreddy.postgresql@gmail.com> wrote:
Hi 
   Help me on getting all toast table information from instance level all databases by using select querying in postgres .


Thanks 
Sathish Reddy 

pgsql-admin by date:

Previous
From: Sathish Reddy
Date:
Subject: Toast table get list from instance
Next
From: Sathish Reddy
Date:
Subject: Re: Toast table get list from instance