Search Postgresql Archives

Re: Get table catalog from pg_indexes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 27/11/2022 18:22 CET Igor Korot <ikorot01@xxxxxxxxx> wrote:
>
> 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

Use SELECT current_database() if you need to know the catalog.
pg_indexes only covers the current database[1].

[1] https://www.postgresql.org/docs/current/view-pg-indexes.html

--
Erik





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux