0

I want to create a column in pg_class for object creation dumping but I am not able to add. I am using below query: ALTER TABLE pg_catalog.pg_class ADD COLUMN relcreated TIMESTAMP;

when I run this query I'm getting below error: ERROR: permission denied: "pg_class" is a system catalog SQL state: 42501 Please suggest any way for object creation time dumping. This is quite important for me for auditing purpose.

2 Answers2

1

That's a system table. You can't just fiddle with them.

You might find event triggers useful though.

Richard Huxton
  • 21,516
  • 3
  • 39
  • 51
0

Set log_statement = 'ddl' and get the information from the log file.

You cannot change a catalog like that “ that would require non-trivial changes to the PostgreSQL code, and you'd lose the information during every upgrade.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263