Viewing the last operation performed

You can use the system views pg_stat_operations and pg_stat_partition_operations to look up actions performed on an object, such as a table. For example, to see the actions performed on a table, such as when it was created and when it was last vacuumed and analyzed:

PSQL>SELECT schemaname as schema, objname as table, usename as role, actionname as action, subtype as type, statime as time 

FROM pg_stat_operations 

WHERE objname='cust';

schema | table | role | action | type | time

--------+-------+------+---------+-------+--------------------------

sales | cust | main | CREATE | TABLE | 2010-02-09 18:10:07.867977-08

sales | cust | main | VACUUM | | 2010-02-10 13:32:39.068219-08

sales | cust | main | ANALYZE | | 2010-02-25 16:07:01.157168-08