Re: select results on pg_class incomplete - Mailing list pgsql-general

From Thiemo Kellner
Subject Re: select results on pg_class incomplete
Date
Msg-id 71cdb9d4-cef9-4294-9464-bb3b89b305b5@gelassene-pferde.biz
Whole thread Raw
In response to Re: select results on pg_class incomplete  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: select results on pg_class incomplete
List pgsql-general

Am 14.03.2024 um 21:03 schrieb David Rowley:
> Yeah, maybe dblink and a LATERAL join might be an easy way. Something like:
> 
> create extension dblink;
> select d.datname,c.relname from pg_database d, lateral (select * from
> dblink('dbname='||d.datname,$$select relname from pg_class where
> relname = 'pg_class';$$) c(relname text)) c
> (relname) where d.datallowconn;
>    datname   | relname
> ------------+----------
>   postgres   | pg_class
>   template1  | pg_class
>   regression | pg_class
> (3 rows)

Thanks for the ideas. As I would want to keep it in the database, dblink 
would be the way to go. Maybe, I will create a prodedure that creates a 
view in the monitor schema accessing the respective databases with union 
all to concatenate the data.



pgsql-general by date:

Previous
From: Rajesh S
Date:
Subject: operator is only a shell - Error
Next
From: vedant patel
Date:
Subject: PostGres ODBC too slow