Thread: recording of INDEX creation in tables

recording of INDEX creation in tables

From
Matthias Apitz
Date:
Hello,

Does the PostgreSQL (11.4 or 13.1) record somewhere in system tables
the creation of INDEXes (or other objects)?

Thanks

    matthias
-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
August 13, 1961: Better a wall than a war. And, while the GDR was still existing,
no German troups and bombs have been killed in Yugoslavia, Afghanistan, Afrika...



Re: recording of INDEX creation in tables

From
Michael Paquier
Date:
On Fri, Jan 21, 2022 at 01:38:59PM +0100, Matthias Apitz wrote:
> Does the PostgreSQL (11.4 or 13.1) record somewhere in system tables
> the creation of INDEXes (or other objects)?

Hard to say what you are looking for with such a general question.

Would pg_index or pg_indexes be enough?  There are a bunch of system
catalogs and views, like what's in information_schema, that provide
this information.  If you are looking for a record of the timestamp
when objects have been created, there is no such tracking in Postgres
itself, but you could use an event trigger for this purpose.

Here are some links;
https://www.postgresql.org/docs/devel/catalog-pg-index.html
https://www.postgresql.org/docs/devel/view-pg-indexes.html
https://www.postgresql.org/docs/devel/event-triggers.html
--
Michael

Attachment

Re: recording of INDEX creation in tables

From
"David G. Johnston"
Date:
On Fri, Jan 21, 2022 at 5:39 AM Matthias Apitz <guru@unixarea.de> wrote:

Hello,

Does the PostgreSQL (11.4 or 13.1) record somewhere in system tables
the creation of INDEXes (or other objects)?


13.1? Really?

Features are not point-release dependent so v11 or v13 suffices when trying to figure out whether some feature exists.

PostgreSQL does not provide auditing-type information in its system tables, they simply represent the current state.  Some features can be used to manually (possibly through community-provided extensions) record such data to non-system tables (which is usually fine with the proper permission setup) or the server log.

David J.

Re: recording of INDEX creation in tables

From
Matthias Apitz
Date:
On Fri, 21 Jan 2022 23:38:44 -0700, David G. Johnston wrote:
> On Fri, Jan 21, 2022 at 5:39 AM Matthias Apitz <guru@unixarea.de> wrote:
>
>>
>> Hello,
>>
>> Does the PostgreSQL (11.4 or 13.1) record somewhere in system tables
>> the creation of INDEXes (or other objects)?
>>
>>
> 13.1? Really?
>

Sorry, this was a typo. 14.1 was meant.

We are hunting a complex issue and I wanted to make sure that all indexes have been recreated as requested.

matthias


--
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
Без книги нет знания, без знания нет коммунизма (Влaдимир Ильич Ленин)
Without books no knowledge - without knowledge no communism (Vladimir Ilyich Lenin)
Sin libros no hay saber - sin saber no hay comunismo. (Vladimir Ilich Lenin)