Re: Get table catalog from pg_indexes

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Igor Korot <ikorot01(at)gmail(dot)com>
Cc: Erik Wienhold <ewie(at)ewie(dot)name>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Get table catalog from pg_indexes
Date: 2022-11-27 18:55:16
Message-ID: EE47A411-5C56-4C31-BB31-70B11EA47071@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Nov 27, 2022, at 10:53, Igor Korot <ikorot01(at)gmail(dot)com> wrote:
> Are you saying I can't run any query on other DB? Or connect to DB and
> run select?

The query you run only looks at the system catalogs for the database you are connected to (with the exception of the small number of global catalogs, like pg_database). So, if you are connected to database "a", you can't query the system catalogs of database "b" for what indexes are in them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2022-11-27 18:55:40 Re: Get table catalog from pg_indexes
Previous Message David G. Johnston 2022-11-27 18:54:47 Re: Get table catalog from pg_indexes