gabriel119435
gabriel119435

Reputation: 6832

How can I discover which user and when an index was created?

I have a postgres table with duplicated indexes (called someName and someName1) applied to the same columns. I would like to know which user executed the ddl that created these indexes, and when it happened. Is this possible on postgres?

Upvotes: 0

Views: 214

Answers (1)

jjanes
jjanes

Reputation: 44305

If you hadn't already set up some kind of auditing or aggressive logging before this happened, then your options are pretty limited.

If you retain WAL files, you could go exploring through those (with pg_waldump and other tools, or by doing PITR) to pinpoint the time. This will probably not be a quick and painless exercise. By looking at surrounding changes, or at log files from the same time, you might be able to figure out who was logged on at the time and also had permissions to create the index.

Upvotes: 2

Related Questions