Sadamh Hussain
Sadamh Hussain

Reputation: 1

how to add new column in pg_class for object creation date dumping

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.

Upvotes: 0

Views: 213

Answers (2)

Laurenz Albe
Laurenz Albe

Reputation: 246308

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.

Upvotes: 0

Richard Huxton
Richard Huxton

Reputation: 22893

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

You might find event triggers useful though.

Upvotes: 1

Related Questions