Re: select results on pg_class incomplete

From: Thiemo Kellner <thiemo(at)gelassene-pferde(dot)biz>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: select results on pg_class incomplete
Date: 2024-03-15 10:30:48
Message-ID: 71cdb9d4-cef9-4294-9464-bb3b89b305b5@gelassene-pferde.biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message vedant patel 2024-03-15 10:40:18 PostGres ODBC too slow
Previous Message Rajesh S 2024-03-15 10:25:45 operator is only a shell - Error