简体   繁体   中英

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.

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

You might find event triggers useful though.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM