From: Ron <ronljohnsonjr@gmail.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Get table catalog from pg_indexes
Date: Sun, 27 Nov 2022 16:10:19 -0600
Message-ID: <5ef334f4-7d7c-0106-9a47-843586706ce6@gmail.com> (raw)
In-Reply-To: <9b91c29f-15d1-a997-f542-e04a752f7944@aklaver.com>
References: <CA+FnnTxHT4K+oRrVytEDVMmG1nLcH9zkMb-_wx-FyKJOJ__zTQ@mail.gmail.com>
<467d46cc-553f-0014-5a09-6ddf7ccf4fdb@gmail.com>
<9b91c29f-15d1-a997-f542-e04a752f7944@aklaver.com>
On 11/27/22 15:55, Adrian Klaver wrote:
> On 11/27/22 13:31, Ron wrote:
>> On 11/27/22 11:22, Igor Korot wrote:
>>> Hi, ALL,
>>> Table pg_indexes does not contain a field for a catalog.
>>>
>>> So how do I get that?
>>>
>>> SELECT 1 FROM pg_indexes WHERE indexname = $1 AND tablename = $2 AND
>>> schemaname = $3
>>
>> You did not look hard enough, or Google "postgresql pg_indexes".
>>
>> test=# \d pg_indexes
>> View "pg_catalog.pg_indexes"
>> Column | Type | Collation | Nullable | Default
>> ------------+------+-----------+----------+---------
>> *schemaname* | name | | |
>> *tablename* | name | | |
>> *indexname* | name | | |
>> tablespace | name | | |
>> indexdef | text | | |
>>
>> https://www.postgresql.org/docs/current/view-pg-indexes.html
>
> What the OP was looking for a field in the above that was catalogname or
> datname per:
I've never heard of a database referred to as a catalog. (That's always
been where a database's metadata -- i.e. the pg_catalog schema -- is stored.)
--
Angular momentum makes the world go 'round.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ronljohnsonjr@gmail.com, adrian.klaver@aklaver.com
Subject: Re: Get table catalog from pg_indexes
In-Reply-To: <5ef334f4-7d7c-0106-9a47-843586706ce6@gmail.com>
References: <CA+FnnTxHT4K+oRrVytEDVMmG1nLcH9zkMb-_wx-FyKJOJ__zTQ@mail.gmail.com> <467d46cc-553f-0014-5a09-6ddf7ccf4fdb@gmail.com> <9b91c29f-15d1-a997-f542-e04a752f7944@aklaver.com> <5ef334f4-7d7c-0106-9a47-843586706ce6@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox